pamaneec / Homeownership-and-integration

Basic template for my research projects
MIT License
0 stars 0 forks source link

screenreg does not work #1

Closed pamaneec closed 3 years ago

pamaneec commented 5 years ago

@AaronGullickson this is my code chuck. I dont know why it does not work.

model6 <- lm_svy_mi(american_perc~home_own+nativity+I(age-40)+I((age-40)^2), imputations)
model7 <- lm_svy_mi(american_perc~home_own+home_investment+nativity+I(age-40)+I((age-40)^2), imputations)
model8 <- lm_svy_mi(american_perc~home_own+exper_moral+exper_opportunity+exper_raising_child+exper_better_country+home_investment+nativity+I(age-40)+I((age-40)^2), imputations)
model9 <- lm_svy_mi(american_perc~exper_moral+exper_opportunity+exper_raising_child+exper_better_country+home_investment+nativity+I(age-40)+I((age-40)^2), imputations)

texreg(lapply(list(model6, model7, model8, model9), convertModel),
          custom.coef.names = c("Intercept",
                            "Own Home",
                             "Nativity",
                            "Age under 40",
                            "Age over 40",
                             "Moral Values of Society",
                             "Opportunity to Get Ahead",
                            "Condition of Raing Children",
                             "Treatment of the Poor"),
       caption="OLS regression models predicting Self Perception as American",
       caption.above = TRUE)

Error in createtexreg(coef.names = rownames(model$coef), coef = model$coef$b.pool, : could not find function "createtexreg"

AaronGullickson commented 5 years ago

@pamaneec

lm_svy_mi is a custom function we created for the OLS regression project to deal with design effects and multiple imputation. It will not work out of the box here and I doubt that you need it as I don't think you are dealing with either of those issues. What you need depends on how american_perc is coded. I think it is binary so you probably need a logistic regression model, which you would run with the glm command and the family=binomial argument.

It would be easier to help you out if your GH repository was up to date. As it is, I have no way to access your analytical data.