Open evielopoo opened 1 month ago
The mice
package defines classes mira
and mipo
, but not mipa
.
Also, try View()
, not view
. The devil is in the details.
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.
My model still runs fine, and I can see that the object is not actually empty if I use str(coxfit1_pool).
I am not able to reproduce your problem.
library(mice, warn.conflicts = FALSE)
library(survival)
set.seed(1)
data <- survival::lung
data$age[rbinom(nrow(data), size = 1, prob = 0.2) == 1] <- NA
data$sex[rbinom(nrow(data), size = 1, prob = 0.2) == 1] <- NA
data$ph.ecog[rbinom(nrow(data), size = 1, prob = 0.2) == 1] <- NA
imp <- mice(data, print = FALSE)
fit <- with(imp, coxph(Surv(time, status) ~ age))
summary(pool(fit))
#> term estimate std.error statistic df p.value
#> 1 age 0.0200698 0.01067183 1.880633 38.41092 0.0676197
Created on 2024-11-21 with reprex v2.1.1
Can you try this code on your system? And, if that works, adapt it to your data?
Discussed in https://github.com/amices/mice/discussions/675