View source: R/tidy_panelGMM.R
tidy_panelGMM | R Documentation |
Turns a 'panelGMM' object into a tidy data frame.
tidy_panelGMM(object)
object |
a 'panelGMM' object |
Lawrence R De Geest, lrdegeest@gmail.com
# Using the hours and wages data provided by the panelGMM package:
data("hours_wages", package = "panelGMM")
# create lagged and differenced instruments
hours_wages_gmm = hours_wages %>%
shiftCols(data = ., panel=id, type = "difference", shifts = 1, columns=c("lnhr", "lnwg", "kids", "age", "agesq", "disab")) %>%
shiftCols(data = ., panel=id, type = "lag", shifts = 1:4, columns=c("lnhr", "lnwg", "kids", "age", "agesq", "disab"))
# define the model
model = lnhr_diff_1 ~ lnwg_diff_1 + kids_diff_1 + age_diff_1 + agesq_diff_1 + disab_diff_1 | kids_lag_1 + kids_lag_2 + age_lag_1 + age_lag_2 + agesq_lag_1 + agesq_lag_2 + disab_lag_1 + disab_lag_2 + lnwg_lag_2
# estimate the parameters with two-step GMM
model_results = panelGMM(model, panel = id, time = year, twostep = TRUE, data = hours_wages_gmm)
# view the results (coefficients, standard errors, p-values) as a data frame:
tidy_panelGMM(model_results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.