library(AER) library(plm) data(Guns) # estimate the extended model model_sete_ext <- # print a summary using robust standard errors # estimate the extended model model_sete_ext <- plm(log(violent) ~ law + prisoners + density + income + population + afam + cauc + male, data = Guns, index = c("state", "year"), model = "within", effect = "twoways") # print a summary using robust standard errors coeftest(model_sete_ext, vcov. = vcovHC, type = "HC1") ex() %>% check_function("plm") %>% { check_arg(., "formula") %>% check_equal() check_arg(., "data") %>% check_equal() check_arg(., "index") %>% check_equal() check_arg(., "model") %>% check_equal() check_arg(., "effect") %>% check_equal() } test_function("coeftest", args="x") test_student_typed("vcov. = vcovHC") success_msg("Correct! Based on the available data there is no evidence for CCW laws being a determinant of crime rates.")