## Replicate second panel of Table I in Amini & Parmeter (2012)
## NOTE: Authors manually scale data, then rescale the resulting coefs and se.
X <- model.matrix(gdpgrowth ~ ., data = GrowthMP)
scaleVector <- apply(X, MARGIN = 2, max)
Xscaled <- apply(X, MARGIN = 2, function(x) x/max(x))
Xscaled <- Xscaled[,-1]
datscaled <- as.data.frame(cbind(gdpgrowth = GrowthMP$gdpgrowth, Xscaled))
fitMP <- wals(gdpgrowth ~ 1 | ., data = datscaled, prescale = FALSE,
prior = laplace(), eigenSVD = FALSE)
tableMP <- cbind("coef" = coef(fitMP)/scaleVector,
"se" = sqrt(diag(vcov(fitMP)))/scaleVector)
printVars <- c("(Intercept)", "lgdp60", "yrsopen", "mining", "primexp70",
"invest")
print(round(tableMP[printVars,], 4))
Run the code above in your browser using DataLab