Dear all,
I am struggling with running the chi-squared analysis on the imputed data. Can someone please share the R code with me using my data below?
I know how to run the logistic regression on the imputed data but can't figure out the chi-squared analysis code for it.
## Chi-squared analysis
chisq.test(mydata$smoking_status, mydata$disease, correct = TRUE)
## multiple imputation
df <- mydata[c("smoking_status", "disease")]
imp1 <- mice(df, m = 5)
## Logistic regression
fitm <- with(imp1, glm(disease~ smoking_status, data=mydata, family=binomial))