## replicates Baltagi (2005, 2013), table 7.4; Baltagi (2021), table 7.5
## preferred way with plm()
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")
summary(ht)
am <- 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 = "am")
summary(am)
## deprecated way with pht() for HT
#ht <- pht(lwage ~ wks + south + smsa + married + exp + I(exp^2) +
# bluecol + ind + union + sex + black + ed |
# sex + black + bluecol + south + smsa + ind,
# data = Wages, model = "ht", index = 595)
#summary(ht)
# deprecated way with pht() for AM
#am <- pht(lwage ~ wks + south + smsa + married + exp + I(exp^2) +
# bluecol + ind + union + sex + black + ed |
# sex + black + bluecol + south + smsa + ind,
# data = Wages, model = "am", index = 595)
#summary(am)
Run the code above in your browser using DataLab