Hi,
I am having a problem running a difference-in-differences regression with two time periods (post=0,1) with the spxtregress command and a spatially lagged error in Stata 15.1.
If I run it using xtreg I get the following result:
. xtreg ln_barleyacres i1.post#c.maltplant_dist i1.post, fe
Fixed-effects (within) regression Number of obs = 912
Group variable: RM_id Number of groups = 456
R-sq: Obs per group:
within = 0.0774 min = 2
between = 0.0123 avg = 2.0
overall = 0.0167 max = 2
F(2,454) = 19.05
corr(u_i, Xb) = 0.0245 Prob > F = 0.0000
------------------------------------------------------------------------------
ln_barleya~s | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
post#|
c. |
maltplant_~t |
1 | -.0012772 .0005777 -2.21 0.028 -.0024126 -.0001418
|
1.post | -.1129585 .1468404 -0.77 0.442 -.4015297 .1756128
_cons | 7.620059 .0489801 155.57 0.000 7.523803 7.716315
-------------+----------------------------------------------------------------
sigma_u | 1.9829009
sigma_e | 1.0459289
rho | .78233246 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(455, 454) = 7.17 Prob > F = 0.0000
However, if I run spxtregress then it drops all the variables:
. spxtregress ln_barleyacres i1.post#c.maltplant_dist i1.post, fe errorlag(W)
Fixed-effects spatial regression Number of obs = 912
Group variable: RM_id Number of groups = 456
Obs per group = 2
Wald chi2(0) = .
Prob > chi2 = .
Log likelihood = -666.1202 Pseudo R2 = .
------------------------------------------------------------------------------
ln_barleya~s | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ln_barleya~s |
post#|
c. |
maltplant_~t |
1 | 0 (omitted)
|
1.post | 0 (omitted)
-------------+----------------------------------------------------------------
W |
e.ln_bar~res | .4522934 .0689628 6.56 0.000 .3171288 .5874579
-------------+----------------------------------------------------------------
/sigma_e | 1.027987 .0343878 .9627505 1.097645
------------------------------------------------------------------------------
Wald test of spatial terms: chi2(1) = 43.01 Prob > chi2 = 0.0000
Can spxtregress handle a panel with just two time periods? I noticed that if I run spxtregress using 16 year panel then the variables are not omitted. Thankful for any help or advice!
I am having a problem running a difference-in-differences regression with two time periods (post=0,1) with the spxtregress command and a spatially lagged error in Stata 15.1.
If I run it using xtreg I get the following result:
. xtreg ln_barleyacres i1.post#c.maltplant_dist i1.post, fe
Fixed-effects (within) regression Number of obs = 912
Group variable: RM_id Number of groups = 456
R-sq: Obs per group:
within = 0.0774 min = 2
between = 0.0123 avg = 2.0
overall = 0.0167 max = 2
F(2,454) = 19.05
corr(u_i, Xb) = 0.0245 Prob > F = 0.0000
------------------------------------------------------------------------------
ln_barleya~s | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
post#|
c. |
maltplant_~t |
1 | -.0012772 .0005777 -2.21 0.028 -.0024126 -.0001418
|
1.post | -.1129585 .1468404 -0.77 0.442 -.4015297 .1756128
_cons | 7.620059 .0489801 155.57 0.000 7.523803 7.716315
-------------+----------------------------------------------------------------
sigma_u | 1.9829009
sigma_e | 1.0459289
rho | .78233246 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(455, 454) = 7.17 Prob > F = 0.0000
However, if I run spxtregress then it drops all the variables:
. spxtregress ln_barleyacres i1.post#c.maltplant_dist i1.post, fe errorlag(W)
Fixed-effects spatial regression Number of obs = 912
Group variable: RM_id Number of groups = 456
Obs per group = 2
Wald chi2(0) = .
Prob > chi2 = .
Log likelihood = -666.1202 Pseudo R2 = .
------------------------------------------------------------------------------
ln_barleya~s | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ln_barleya~s |
post#|
c. |
maltplant_~t |
1 | 0 (omitted)
|
1.post | 0 (omitted)
-------------+----------------------------------------------------------------
W |
e.ln_bar~res | .4522934 .0689628 6.56 0.000 .3171288 .5874579
-------------+----------------------------------------------------------------
/sigma_e | 1.027987 .0343878 .9627505 1.097645
------------------------------------------------------------------------------
Wald test of spatial terms: chi2(1) = 43.01 Prob > chi2 = 0.0000
Can spxtregress handle a panel with just two time periods? I noticed that if I run spxtregress using 16 year panel then the variables are not omitted. Thankful for any help or advice!
Comment