Dear Statalist users,
I am using the 'actest' command to conduct a serial correlation test after time-series regressions. However, I need to repeat the test 48 times (i.e., after each of the 48 regressions). So, I am trying to write a Stata code that generates the results automatically as follows:
matrix autocorr=J(48,7,.)
local i=1
forvalues j = 1/48 {
reg y x1 x2 x3 x4 if id==`j', robust
actest, r q0 lag(1/3)
matrix [`i',1]=(r(p))
i=`i'+1
}
matrix list autocorr
I get the message:
matrix operation not found
r(501);
I need help on how to fix the issue.
Thanks in advance for your reply.
Emna
Related Posts with Store p-values in a matrix after 'actest'
Creating unique group ID variableDear all I have a hopefully trivial question that I can't get my head around right now. My data set…
New package predsurv on SSCThanks as always to Kit Baum, a new package predsurv is now available for download from SSC. In Stat…
import data from excel to stata-change the structure of the dataHi, I have a data file in excel which includes more than 300 firms. Information for each firm inclu…
How to tag outliers?Hi, I would like to create a dummy that's equal to 1 if it's an outlier, and 0 if not. I can use -ex…
Syntax for lincom won't work in Stata 16 but works fine in Stata 15Hello all. I'm a professor at Baldwin Wallace. On Thursday, I tried to run a lab with my class from …
Subscribe to:
Post Comments (Atom)
0 Response to Store p-values in a matrix after 'actest'
Post a Comment