Hi, guys! So I have a problem. I'm trying to use the Wooldridge/Hausman test that Hoechle suggests in his 2007 paper Robust Standard Errors for Panel Regressionswith Cross-Sectional Dependence. This is the code he suggests:
. qui xtreg BA aVol Size TRMS2 TRMS, re
. scalar lambda_hat = 1 - sqrt(e(sigma_e)^2/(e(g_avg)*e(sigma_u)^2+e(sigma_e)^2))
. gen in_sample = e(sample)
. sort ID TDate. qui foreach var of varlist BA aVol Size TRMS2 TRMS {
. by ID: egen ‘var’_bar = mean(‘var’) if in_sample
. gen ‘var’_re = ‘var’ - lambda_hat*‘var’_bar if in_sample // GLS-transform
. gen ‘var’_fe = ‘var’ - ‘var’_bar if in_sample // within-transform
.}
. * Wooldridge’s auxiliary regression for the panel-robust Hausman test:
. reg BA_re aVol_re Size_re TRMS2_re TRMS_re aVol_fe Size_fe TRMS2_fe
> TRMS_fe if in_sample, cluster(ID)(output omitted)
. * Test of the null-hypothesis ‘‘gamma==0’’:
. test aVol_fe Size_fe TRMS2_fe TRMS_fe
( 1) aVol_fe = 0
( 2) Size_fe = 0
( 3) TRMS2_fe = 0
( 4) TRMS_fe = 0
F( 4, 218) = 2.40
Prob>F= 0.0510
I enter the following code into STATA:
. qui xtreg Employmentrate Taxwedge HICP GDPgrowth, re
. scalar lambda_hat = 1 - sqrt(e(sigma_e)^2/(e(g_avg)*e(sigma_u)^2+e(sigma_e)^2))
. gen in_sample = e(sample)
. sort Country Year
. qui foreach var of varlist Employmentrate Taxwedge HICP GDPgrowth {
. by Country : egen ‘var’_bar = mean(‘var’) if in_sample
. gen ‘var’_re = ‘var’ - lambda_hat*‘var’_bar if in_sample
. gen ‘var’_fe = ‘var’ - ‘var’_bar if in_sample
. }
And get the following error message:
‘var’_bar invalid name
Now, obviously this means that I have violated some kind of naming parameter for STATA, but what do I do about that? How do I fix this?
Related Posts with Problem using Hoechle's Hausman test for Driscoll-Kraay standard errors
Interpreting Odds RatiosI need advice on the correct interpretation of an odds ratio of an interaction term. Both the mixed…
Common Correlated Effects and Serial CorrelationHello everyone, I have the following question related to testing residuals for serial correlation a…
how to draw multi-classification ROC curve use statahello everyone ! i want to test the diagnostic value of a b c d. and the gold standard is multi-clas…
dependent variable with gap in a panel data with repeated time valuesHello Statalist, I have panel data with repeated time values. The reason is that there are more tha…
how to draw multi-classification ROC curve use statahello everyone ! i want to test the diagnostic value of a b c d. and the gold standard is multi-clas…
Subscribe to:
Post Comments (Atom)
0 Response to Problem using Hoechle's Hausman test for Driscoll-Kraay standard errors
Post a Comment