1. Samar
    5 years & 5 months ago

    hello ,
    The above part is very helpful.Please do let me know how to perform ARIMAX in Stata and how to do the prediction part in ARIMAX and how many X variables can be used in ARIMAX ?

  2. Simon Turner
    5 years & 5 months ago

    This is super helpful!
    One question I have is in extracting the data from Stata in my do file?
    I can find the value of, eg. AR(1) in the returned e(b), but can’t find the standard error or confidence interval in any of the returned lists (although they’re displayed on the screen I’d like to store the values in a local macro).
    Is there a way to do this?
    Thanks!

  3. Sudeshna
    5 years & 9 months ago

    Dear Colleen,

    Thanks for sharing your concern!
    For interrupted time series analysis (ITSA), it’s better to use OLS over ARIMA, as the former is more flexible and broadly applicable in an interrupted time-series context.

    The syntax (code) to use for itsa is:

    itsa depvar [indepvars] [if] [in] [weight], trperiod(numlist) [ single treatid(#) contid(numlist) prais lag(#) figure posttrend replace prefix(string) model_options ]

    Note, this code is data specific but I have presented the full form of the common codes below:

    trperiod(numlist) specifies the time period when the intervention begins. The values entered for time period must be in the same units as the panel time variable specified in tsset timevar; see [TS] tsset. More than one period may be specified.
    trperiod() is required.

    single indicates that itsa will be used for a single group analysis. Conversely, omitting single indicates that itsa is for a multiple group comparison.

    treatid(#) specifies the identifier of the single treated unit under study when the dataset contains multiple panels. The value entered must be in the same units as the panel variable specified in tsset panelvar timevar; see [TS] tsset. When the dataset contains data for only a single panel, treatid() must be omitted.

    contid(numlist) specifies a list of identifiers to be used as control units in the multiple group analysis. The values entered must be in the same units as the panel variable specified in tsset panelvar timevar; see [TS] tsset. If contid() is not specified, all non-treated units in the data will be used as controls.

    prais specifies that a prais model should be estimated. If prais is not specified, itsa will use newey as the default model.

    lag(#) specifies the maximum lag to be considered in the autocorrelation structure when a newey model is chosen. If the user specifies lag(0), the output is the same as regress, vce(robust); Default is lag(0). An error message will appear if both prais and lag() are specified, as prais implements an AR(1) model, by design.

    figure produces a line plot of the predicted depvar variable combined with a scatter plot of the actual values of depvar over time. In a multiple group analysis, figure plots the average values of all controls used in the analysis (more specifically, data for specified controls are collapsed and the monthly observations averaged).

    posttrend produces post-treatment trend estimates using lincom, for the specified model. In the case of a single-group ITSA, one estimate is produced. In the case of a multiple-group ITSA, an estimate is produced for the treatment group, the control
    group, and the difference. In the case of multiple treatment periods, a separate table is produced for each treatment period.
    replace replaces variables created by itsa if they already exist. If prefix() is specified, only variables created by itsa with the same prefix will be replaced.

    prefix(string) adds a prefix to the names of variables created by itsa. Short prefixes are recommended.

    model_options specifies all available options for prais when the prais option is chosen; otherwise all available options of newey other than lag().

    Hope the above notes help. Do let us know!

  4. Colleen
    5 years & 9 months ago

    Hello,

    Thank you for this information. I have found the ARIMA model for the time series I will be analyzing. I am not sure, however, how to perform the interrupted time series analysis in stata using these ARIMA models. I am not sure what commands I would use to perform this analysis in STATA with the ARIMA models.

    Thank you.

  5. Dejan
    6 years & 1 week ago

    All the discussions you have posted on time series analysis in STATA are excellent, brief and applicable. Thank You Very Much.