amices / mice

Multivariate Imputation by Chained Equations
https://amices.org/mice/
GNU General Public License v2.0
443 stars 107 forks source link

Object created from pool() is empty but producing mean estimate when using summary() #676

Open evielopoo opened 2 weeks ago

evielopoo commented 2 weeks ago

Discussed in https://github.com/amices/mice/discussions/675

Originally posted by **evielopoo** October 10, 2024 This code has been running fine for months: ``` coxfit1 <- with(imp30_mids, coxph(Surv(recid, fail) ~ vet)) summary(coxfit1) coxfit1_pool <- pool(coxfit1) ``` However, starting yesterday it was returning number of observations = total number of failures, not the total number of failures + censored events. Also, my object "coxfit1_pool" is of class mipa and produces an estimate, but when I use the command view(coxfit1_pool), RStudio returns "error: object not found". Any idea what is going on here? It doesn't seem to be an issue with the imputed dataset itself (if I extract m=1 imputed dataset, it returns the correct number of observations and has no missing values).
stefvanbuuren commented 2 weeks ago

The mice package defines classes mira and mipo, but not mipa.

stefvanbuuren commented 2 weeks ago

Also, try View(), not view. The devil is in the details.

evielopoo commented 2 weeks ago

Sorry for the typo, the class is indeed mipo. However, whether I use View() or view() the object returns the same error, attached in a screenshot.

Screen Shot 2024-10-11 at 11 28 05 AM

My model still runs fine, and I can see that the object is not actually empty if I use str(coxfit1_pool).