Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

Stata 2

Notes:

1. (/v# option or -set maxvar-) 5000 maximum variables

Checking for updates...

(contacting http://www.stata.com)

bad serial number

unable to check for update; verify Internet settings are correct.

. use "C:\Users\BLADIMIR\Downloads\mus08cigar (1).dta"

. xtset state year

panel variable: state (strongly balanced)

time variable: year, 63 to 92

delta: 1 unit

. sum

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

state | 300 5.5 2.87708 1 10

year | 300 77.5 8.669903 63 92

lnp | 300 4.518424 .1406979 4.176332 4.96916

lnpmin | 300 4.4308 .1379243 4.0428 4.831303

lnc | 300 4.792591 .2071792 4.212128 5.690022

-------------+--------------------------------------------------------

lny | 300 8.731014 .6942426 7.300023 10.0385

. xtdes
state: 1, 2, ..., 10 n= 10

year: 63, 64, ..., 92 T= 30

Delta(year) = 1 unit

Span(year) = 30 periods

(state*year uniquely identifies each observation)

Distribution of T_i: min 5% 25% 50% 75% 95% max

30 30 30 30 30 30 30

Freq. Percent Cum. | Pattern

---------------------------+--------------------------------

10 100.00 100.00 | 111111111111111111111111111111

---------------------------+--------------------------------

10 100.00 | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

. xtgls lnc lnp lny lnpmin year, panels(correlated) corr(psar1)

Cross-sectional time-series FGLS regression

Coefficients: generalized least squares

Panels: heteroskedastic with cross-sectional correlation

Correlation: panel-specific AR(1)

Estimated covariances = 55 Number of obs = 300

Estimated autocorrelations = 10 Number of groups = 10

Estimated coefficients = 5 Time periods = 30

Wald chi2(4) = 342.15

Prob > chi2 = 0.0000


------------------------------------------------------------------------------

lnc | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.3260683 .0218214 -14.94 0.000 -.3688375 -.2832991

lny | .4646236 .0645149 7.20 0.000 .3381768 .5910704

lnpmin | .0174759 .0274963 0.64 0.525 -.0364159 .0713677

year | -.0397666 .0052431 -7.58 0.000 -.0500429 -.0294902

_cons | 5.157994 .2753002 18.74 0.000 4.618416 5.697573

------------------------------------------------------------------------------

. xtpcse lnc lnp lny lnpmin year, corr(ind) independent nmk

Linear regression, independent panels corrected standard errors

Group variable: state Number of obs = 300

Time variable: year Number of groups = 10

Panels: independent (balanced) Obs per group: min = 30

Autocorrelation: no autocorrelation avg = 30

max = 30

Estimated covariances = 1 R-squared = 0.4159

Estimated autocorrelations = 0 Wald chi2(4) = 210.03

Estimated coefficients = 5 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

| Indep-corrected

lnc | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.5834604 .1289564 -4.52 0.000 -.8362102 -.3307105


lny | .3654305 .0485545 7.53 0.000 .2702655 .4605955

lnpmin | -.0271545 .128047 -0.21 0.832 -.278122 .2238129

year | -.0331779 .0039306 -8.44 0.000 -.0408818 -.025474

_cons | 6.929938 .3530448 19.63 0.000 6.237983 7.621893

------------------------------------------------------------------------------

. estimates store OLS_iid

. xtpcse lnc lnp lny lnpmin year, corr(ind)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable: state Number of obs = 300

Time variable: year Number of groups = 10

Panels: correlated (balanced) Obs per group: min = 30

Autocorrelation: no autocorrelation avg = 30

max = 30

Estimated covariances = 55 R-squared = 0.4159

Estimated autocorrelations = 0 Wald chi2(4) = 215.44

Estimated coefficients = 5 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

| Panel-corrected

lnc | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.5834604 .1687292 -3.46 0.001 -.9141635 -.2527572

lny | .3654305 .0803418 4.55 0.000 .2079635 .5228975

lnpmin | -.0271545 .1663671 -0.16 0.870 -.3532282 .2989191

year | -.0331779 .0062349 -5.32 0.000 -.0453982 -.0209576


_cons | 6.929938 .329672 21.02 0.000 6.283793 7.576084

------------------------------------------------------------------------------

. estimates store OLS_cor

. findit

. xtscc lnc lnp lny lnpmin year, lag(4)

Regression with Driscoll-Kraay standard errors Number of obs = 300

Method: Pooled OLS Number of groups = 10

Group variable (i): state F( 4, 9) = 162.99

maximum lag: 4 Prob > F = 0.0000

R-squared = 0.4159

Root MSE = 0.1594

------------------------------------------------------------------------------

| Drisc/Kraay

lnc | Coef. Std. Err. t P>|t| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.5834604 .2727017 -2.14 0.061 -1.200355 .0334338

lny | .3654305 .1630793 2.24 0.052 -.0034804 .7343414

lnpmin | -.0271545 .2524201 -0.11 0.917 -.5981684 .5438594

year | -.0331779 .0120469 -2.75 0.022 -.06043 -.0059258

_cons | 6.929938 .5148789 13.46 0.000 5.765201 8.094675

------------------------------------------------------------------------------

. estimates store OLS_DK


. xtpcse lnc lnp lny lnpmin year, corr(ar1)

(note: estimates of rho outside [-1,1] bounded to be in the range [-1,1])

Prais-Winsten regression, correlated panels corrected standard errors (PCSEs)

Group variable: state Number of obs = 300

Time variable: year Number of groups = 10

Panels: correlated (balanced) Obs per group: min = 30

Autocorrelation: common AR(1) avg = 30

max = 30

Estimated covariances = 55 R-squared = 0.9678

Estimated autocorrelations = 1 Wald chi2(4) = 58.78

Estimated coefficients = 5 Prob > chi2 = 0.0000

------------------------------------------------------------------------------

| Panel-corrected

lnc | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.2662515 .0491443 -5.42 0.000 -.3625724 -.1699305

lny | .3983667 .1245071 3.20 0.001 .1543373 .6423961

lnpmin | .0688652 .0644494 1.07 0.285 -.0574533 .1951837

year | -.0377398 .0097441 -3.87 0.000 -.0568379 -.0186417

_cons | 5.115052 .5435645 9.41 0.000 4.049685 6.180419

-------------+----------------------------------------------------------------

rho | .9481967

------------------------------------------------------------------------------

. estimates store AR1_cor


. xtgls lnc lnp lny lnpmin year, corr (ar1) panels (iid)

Cross-sectional time-series FGLS regression

Coefficients: generalized least squares

Panels: homoskedastic

Correlation: common AR(1) coefficient for all panels (0.9582)

Estimated covariances = 1 Number of obs = 300

Estimated autocorrelations = 1 Number of groups = 10

Estimated coefficients = 5 Time periods = 30

Wald chi2(4) = 95.94

Prob > chi2 = 0.0000

------------------------------------------------------------------------------

lnc | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.2635938 .0488858 -5.39 0.000 -.3594081 -.1677795

lny | .397358 .0943413 4.21 0.000 .2124524 .5822636

lnpmin | .0704482 .0585746 1.20 0.229 -.0443559 .1852522

year | -.0377098 .0073111 -5.16 0.000 -.0520392 -.0233804

_cons | 5.099936 .4136474 12.33 0.000 4.289202 5.91067

------------------------------------------------------------------------------

. estimates store FGLSAR1

. xtgls lnc lnp lny lnpmin year, corr(ar1) panels (correlated)


Cross-sectional time-series FGLS regression

Coefficients: generalized least squares

Panels: heteroskedastic with cross-sectional correlation

Correlation: common AR(1) coefficient for all panels (0.9582)

Estimated covariances = 55 Number of obs = 300

Estimated autocorrelations = 1 Number of groups = 10

Estimated coefficients = 5 Time periods = 30

Wald chi2(4) = 225.25

Prob > chi2 = 0.0000

------------------------------------------------------------------------------

lnc | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.3295056 .0258459 -12.75 0.000 -.3801626 -.2788486

lny | .4067699 .0800336 5.08 0.000 .249907 .5636328

lnpmin | .0363268 .0337803 1.08 0.282 -.0298813 .1025349

year | -.0366813 .0064479 -5.69 0.000 -.049319 -.0240436

_cons | 5.392761 .3611838 14.93 0.000 4.684854 6.100668

------------------------------------------------------------------------------

. estimates store FGLSCAR

. xtgls lnc lnp lny lnpmin year, corr(ar1) panels (iid)

Cross-sectional time-series FGLS regression

Coefficients: generalized least squares


Panels: homoskedastic

Correlation: common AR(1) coefficient for all panels (0.9582)

Estimated covariances = 1 Number of obs = 300

Estimated autocorrelations = 1 Number of groups = 10

Estimated coefficients = 5 Time periods = 30

Wald chi2(4) = 95.94

Prob > chi2 = 0.0000

------------------------------------------------------------------------------

lnc | Coef. Std. Err. z P>|z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

lnp | -.2635938 .0488858 -5.39 0.000 -.3594081 -.1677795

lny | .397358 .0943413 4.21 0.000 .2124524 .5822636

lnpmin | .0704482 .0585746 1.20 0.229 -.0443559 .1852522

year | -.0377098 .0073111 -5.16 0.000 -.0520392 -.0233804

_cons | 5.099936 .4136474 12.33 0.000 4.289202 5.91067

------------------------------------------------------------------------------

. estimates table OLS_iid OLS_cor OLS_DK AR1_cor FGLSAR1 FGLSCAR, se

--------------------------------------------------------------------------------------------

Variable | OLS_iid OLS_cor OLS_DK AR1_cor FGLSAR1 FGLSCAR

-------------+------------------------------------------------------------------------------

lnp | -.58346035 -.58346035 -.58346035 -.26625146 -.26359382 -.32950559

| .12895638 .16872921 .27270173 .04914425 .04888576 .02584589

lny | .36543048 .36543048 .36543048 .39836669 .39735799 .40676988

| .04855445 .08034177 .16307925 .12450709 .09434134 .08003355

lnpmin | -.02715454 -.02715454 -.02715454 .06886522 .07044816 .0363268


| .12804698 .16636715 .25242008 .06444941 .05857458 .03378027

year | -.03317792 -.03317792 -.03317792 -.03773981 -.0377098 -.03668131

| .00393064 .00623495 .01204694 .00974412 .00731107 .00644792

_cons | 6.9299384 6.9299384 6.9299384 5.1150523 5.0999363 5.392761

| .35304476 .329672 .51487888 .54356454 .41364737 .36118384

--------------------------------------------------------------------------------------------

legend: b/se

. statsby, by(state) clear: regress lnc lnp lny lnpmin year

(running regress on estimation sample)

command: regress lnc lnp lny lnpmin year

by: state

Statsby groups

----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5

..........

. list

+-----------------------------------------------------------------+

| state _b_lnp _b_lny _b_lnpmin _b_year _b_cons |

|-----------------------------------------------------------------|

1. | 1 -.3572344 1.102418 .2403018 -.0806138 2.098109 |

2. | 2 .1158018 .60493 -.4469771 -.054202 5.13989 |

3. | 3 -.2018599 .7590277 .1185762 -.0519536 2.72316 |

4. | 4 -.5220097 -.136463 -.2108071 -.004123 9.562363 |

5. | 5 -.5480368 .714488 .2954964 -.0676539 4.757004 |

|-----------------------------------------------------------------|
6. | 6 -.107686 .2105353 -.1405058 -.0247648 6.196794 |

7. | 7 -.4290425 -.070987 .17558 -.0299024 9.144891 |

8. | 8 -.2616858 .8875868 .0843838 -.0744584 3.673701 |

9. | 9 -.0279442 .5471967 -.356997 -.0380047 4.693635 |

10. | 10 -1.412641 1.122632 1.1434 -.0834966 2.703295 |

+-----------------------------------------------------------------+

You might also like