Nagelkerke r-square in multiple imputed datasets #694
AngeloArias97
started this conversation in
Impute, analyse and pool
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Prof. van Buuren,
Thank you for developing such an amazing tool. I was wondering if you can guide me to obtain Nagelkerke r-square value from my logistic regression model.
See an example of my code.
model1 <- with(imp, {
data <- data.frame(
lapply(seq_along(exposome_factors), function(i) {
as.numeric(get(exposome_factors[i])) * coefficients[i]
})
)
colnames(data) <- exposome_factors
data$ES_SCZ <- rowSums(data) + 2
data$ES_SCZ <- scale(data$ES_SCZ)
data$ES_SCZ <- ifelse(data$ES_SCZ >= quantile(data$ES_SCZ, 0.75, na.rm = TRUE), 1, 0)
glm(PE_18_Distressing ~ ES_SCZ + sex + maternal_education + imd_income_1993_maternal, data = data, family = binomial)
})
pooled_results1 <- pool(model1)
summary(pooled_results1, conf.int = TRUE)
In stackoverflow i found this answer, do you think is appropriate for my case? https://stackoverflow.com/questions/65245547/using-mice-inputed-data-sets-in-glm-analysis-can-pooled-model-fit-indices-be-ob
Thank you so much!
Beta Was this translation helpful? Give feedback.
All reactions