0

I have run mice to create 50 imputed datasets. Now, I am trying to compute chi-square statistics for some of my variables.

It is possible to obtain individual estimates for each dataset:

list <- with(imp, chisq.test(var1, var2, correct = FALSE))

But the results cannot be pooled. It is possible to combine the results in miceadds, but the function requires a vector of chi-square statistics.

How do I extract the relevant information from list$analyses[[i]]$statistic? I assume lapply would be appropriate, but I am not sure how to specify it for a list of lists.

slamballais
  • 3,161
  • 3
  • 18
  • 29
C_H
  • 191
  • 14

1 Answers1

0

EDIT: The answer provided here seems to be appropriate:

x2 <- lapply(list$analyses, `[`, 'statistic')
x2 <- unlist(x2, use.names = FALSE)
C_H
  • 191
  • 14