Closed sondalex closed 1 year ago
The R code you provide gives different results compared to the output you supplied on my side, so not reproducible for me. I use plm 2.6-2 and broom 1.0.1.
I do get the same results as Stata gives. Also have a look at the 2nd plm vignette where the model is estimated as well (https://cran.r-project.org/web/packages/plm/vignettes/B_plmFunction.html, section Instrumental variable estimators).
Could you please double check in a clean R session?
library(broom) # v1.0.1
library(plm) # v2.6-2
data(Wages, package = "plm")
ht <- plm(lwage ~ wks + south + smsa + married + exp + I(exp ^ 2) +bluecol + ind + union + sex + black + ed |
bluecol + south + smsa + ind + sex + black |
wks + married + union + exp + I(exp ^ 2),
data = Wages, index = 595, random.method = "ht",
model = "random", inst.method = "baltagi"
)
print(tidy(ht), n=13)
#> # A tibble: 13 × 5
#> term estimate std.error statistic p.value
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 (Intercept) 2.91 0.284 10.3 9.76e-25
#> 2 wks 0.000837 0.000600 1.40 1.63e- 1
#> 3 southyes 0.00744 0.0320 0.233 8.16e- 1
#> 4 smsayes -0.0418 0.0190 -2.21 2.73e- 2
#> 5 marriedyes -0.0299 0.0190 -1.57 1.16e- 1
#> 6 exp 0.113 0.00247 45.8 0
#> 7 I(exp^2) -0.000419 0.0000546 -7.67 1.70e-14
#> 8 bluecolyes -0.0207 0.0138 -1.50 1.33e- 1
#> 9 ind 0.0136 0.0152 0.893 3.72e- 1
#> 10 unionyes 0.0328 0.0149 2.20 2.79e- 2
#> 11 sexfemale -0.131 0.127 -1.03 3.01e- 1
#> 12 blackyes -0.286 0.156 -1.84 6.65e- 2
#> 13 ed 0.138 0.0212 6.49 8.47e-11
Thank you for your help.
I did a mistake converting all columns to numeric and created the reproducible example from this "dirty" session. Sorry for raising an unnecessary issue.
No worries - thank you for checking and confirming!
Hi,
I have noticed that Hausman-Taylor model (1981) estimated intercept coefficient are different from those in Stata
xthtaylor
command. Is this behaviour intentional ?Reproducible Example:
Intercept ≃ 3.38
And in Stata (v17):
Intercept ≃ 2.91