Hi all,
I'm using user-written xtserial and I'm struggling with saving the information.
Here is a sample of my data:
My regression is:
I wanted to get the autocorrelation results saved in the above excel doc, so I tried:
This seems to work, but the results that appear in Stata are different from what appears in my regression_results. My Stata results:
Linear regression Number of obs = 1,961
F(1, 76) = 149.52
Prob > F = 0.0000
R-squared = 0.0752
Root MSE = .09181
(Std. Err. adjusted for 77 clusters in Fullid)
------------------------------------------------------------------------------
| Robust
D.logthpp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
logprevcpn |
D1. | -.2014026 .016471 -12.23 0.000 -.2342075 -.1685977
------------------------------------------------------------------------------
Wooldridge test for autocorrelation in panel data
H0: no first-order autocorrelation
F( 1, 76) = 47.863
Prob > F = 0.0000
My excel results:
Coefficient: -.1300**
Observations: 1876
R-squared 0.017
Does anyone have any idea why the Stata-results would differ from the saved results in excel?
Also, I'm confused as to what F(1, 76)= 47.863 indicates. I thought that (1, 76) should represent my N and T but I've got 77 companies represented (N) and about 70 time periods...so I'm not entirely sure what is happening here.
I'm using user-written xtserial and I'm struggling with saving the information.
Here is a sample of my data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long Fullid float(time logthpp logprevcpn) 1 -204 -.07918125 . 1 -202 -.06382149 2.968016 1 -200 -.05305674 2.9726655 1 -199 -.04175473 3.001734 1 -198 -.04175473 3.0216026 1 -197 .04270675 3.043755 1 -196 .09633057 3.062958 1 -195 .0934217 3.075912 1 -194 -.03229605 3.0982976 1 -193 .09108047 3.1169395 1 -192 -.05142405 3.1332195 1 -191 -.024568195 3.1504495 2 -204 .3460734 . 2 -203 .3656217 1.544068 2 -202 .59423465 1.832509 2 -201 .59423465 2.045323 2 -200 .3767073 2.2479732 2 -199 .20431383 2.3961995 2 -198 .20431383 2.5037906 2 -197 .1045359 2.591065 2 -196 .1033149 2.668386 2 -195 .19728057 2.731589 2 -194 .10648232 2.7916906 2 -193 .1775365 2.841985 2 -192 .11750802 2.886491 2 -191 .1645653 2.926857 2 -190 .1645653 2.951823 3 -213 .6373078 .7781513 3 -212 .456642 1.2787536 3 -211 .3004374 1.6812413 3 -210 .20527 1.9822712 3 -209 .10792907 2.1731863 3 -208 .10359641 2.4785664 3 -207 .06773569 2.6294096 3 -206 .01665353 2.748188 3 -205 -.001846379 2.848805 3 -204 .11292981 2.923244 3 -203 .08005774 3.041393 3 -202 -.03908259 3.079181 3 -201 -.03908259 3.113943 3 -200 -.03908259 3.146128 3 -199 -.03908259 3.176091 3 -198 -.03908259 3.20412 3 -197 -.03908259 3.230449 4 -220 .6003547 1.3424227 4 -219 .57465684 1.50515 4 -218 .55444 1.6434526 4 -217 .5614237 1.763428 4 -216 .52935606 1.863323 4 -215 .5112851 2.089905 4 -214 .4620432 2.307496 4 -213 .3269823 2.463893 4 -212 .2680974 2.563481 4 -211 .2365903 2.656098 4 -210 .1932711 2.74351 4 -209 .19376005 2.8247764 4 -208 .17513096 2.893207 4 -207 .1680165 2.9561684 4 -206 .18208003 3.008174 4 -205 .17273673 3.056142 6 -204 .4780352 . 6 -203 .4665558 2.462398 6 -202 .4579219 2.518514 6 -201 .433721 2.60206 6 -200 .41151395 2.6532125 6 -199 .3767709 2.69897 6 -198 .3544976 2.778151 6 -197 .3320456 2.845098 6 -196 .2885081 2.90309 6 -195 .26468587 2.9542425 6 -194 .2358847 3 6 -193 .2166431 3.079181 6 -192 .19993736 3.176091 6 -191 .18814093 3.2552724 6 -190 .17562827 3.30103 6 -189 .15704262 3.39794 6 -188 .1605366 3.477121 6 -187 .14149216 3.56134 6 -186 .14696562 3.582745 6 -185 .14696562 3.5995555 6 -184 .14696562 3.6167905 6 -183 .14696562 3.630428 6 -182 .10241515 3.641573 6 -181 .10241515 3.6517625 6 -180 .11431438 3.660771 6 -179 .11431438 3.668386 6 -178 .11431438 3.675045 6 -177 .11431438 3.682416 6 -176 .10237654 3.689131 6 -175 .09010122 3.696007 7 -233 .9186395 . 7 -232 .8618895 0 7 -231 .7921265 .30103 7 -230 .8579027 .4771213 7 -229 .7215655 .69897 7 -228 .7762895 .9542425 7 -227 .7230359 1.0791812 7 -226 .7003575 1.3802112 7 -225 .6690378 1.462398 7 -224 .56469893 1.544068 end format %tm time label values Fullid Fullid label def Fullid 1 "Aeronca-Middletown-L-3", modify label def Fullid 2 "Aeronca-Middletown-PT-19-23", modify label def Fullid 3 "Beech-Witchita-AT-10", modify label def Fullid 4 "Beech-Witchita-AT-7-11_UC-45", modify label def Fullid 6 "Beech-Witchita-UC-45_Model 18", modify label def Fullid 7 "Bell-Buffalo-P-39", modify
Code:
regress logthpp logprevcpn outreg2 using regression_results, replace excel
Code:
regress logthpp logprevcpn outreg2 using regression_results, replace excel xtserial logthpp logprevcpn, output outreg2 using regression_results, append excel
Linear regression Number of obs = 1,961
F(1, 76) = 149.52
Prob > F = 0.0000
R-squared = 0.0752
Root MSE = .09181
(Std. Err. adjusted for 77 clusters in Fullid)
------------------------------------------------------------------------------
| Robust
D.logthpp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
logprevcpn |
D1. | -.2014026 .016471 -12.23 0.000 -.2342075 -.1685977
------------------------------------------------------------------------------
Wooldridge test for autocorrelation in panel data
H0: no first-order autocorrelation
F( 1, 76) = 47.863
Prob > F = 0.0000
My excel results:
Coefficient: -.1300**
Observations: 1876
R-squared 0.017
Does anyone have any idea why the Stata-results would differ from the saved results in excel?
Also, I'm confused as to what F(1, 76)= 47.863 indicates. I thought that (1, 76) should represent my N and T but I've got 77 companies represented (N) and about 70 time periods...so I'm not entirely sure what is happening here.
Comment