I'm working on a logistic regression model; the purpose of the analysis is to identify factors that influence use of an app - the DV being use/no use, and IVs being a couple of numerical and categorical variables.
I want to do a hierarchical regression and add variables step-wise, and compare how much each variable improves the model. At the moment I define multiple models, add a variable for each model, compare the models using an ANOVA and save and compare the (adjusted) R squares in a table:
model1 <- glm(mh_use ~ Q7, data = results_mod, family = "binomial") model2 <- glm(mh_use ~ Q7 + Q6_4_TEXT, data = results_mod, family = "binomial") model3 <- glm(mh_use ~ Q7 + Q6_4_TEXT + Q66, data = results_mod, family = "binomial") anova(model1, model2, model3, test= "Chisq") rtbl <- matrix(nrow = 3, ncol = 2, byrow = TRUE) rtbl[1,] <- c(rsq(model1), rsq(model1,adj=TRUE)) rtbl[2,] <- c(rsq(model2), rsq(model2,adj=TRUE)) rtbl[3,] <- c(rsq(model3), rsq(model3,adj=TRUE))
Rather than doing this manually, I was wondering if there is a package/function in R that does this for you and gives the relevant results? And is R squared the best comparison for logistic regression or should I include other measures?