Dear Statalist community,
I have trouble writing the code and would greatly appreciate your help.
I am working on a panel of quarterly data for 37 countries. I investigate the variability of different types of capital flows. For that purpose I will need to run a separate ARIMA (1,1,0) of each type of capital flow for each country and calculate the corresponding residuals. Afterwards, I need to calculate the separate rolling standard deviation (over 5 quarters) of each series of residuals.
So I have:
c_id quarter y1....y19 (with y I name the different types of capital flows)
And I use the following code which needs improvement
local z "y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19"
. foreach k of local z {
. qby c_id: reg `k' l.d. `k'
predict residuals, residuals
egen sd_residuals=sd(residuals), by(quarter)
. }
Thank you in advance.
Related Posts with Rolling window standard deviation of residuals in ARIMA
Interaction terms and subsequent stratified analyses, when using multiple imputation/chained equationsThank you in advance for any technical advice you can give. I am currently using MICE to address mi…
Quarterly FormatHello, I have a longitudinal data set. Here, it is a quarterly data set, but the time format is Yea…
FE and POLS same resultFor my master thesis I am trying analyse what are the determinants of Non Performing Loans on a samp…
Difficulty working with time variableHi, I thought I had cracked this but seemingly not: After having trouble importing variables conta…
Rename variables based on a separate list of namesHello, I am working with a dataset of stock prices that has 505 variables (firms) with 1.578 observ…
Subscribe to:
Post Comments (Atom)
0 Response to Rolling window standard deviation of residuals in ARIMA
Post a Comment