Skip to content
Discussion options

You must be logged in to vote

Thanks for the detailed reprex, @irenerlover.

This is not a bug in mice — it is a consequence of how as.mids() reconstructs the mids object.

Two things worth noting first

1. Type mismatch warning

You will see:

    Warning: Type mismatch for variable(s): remission_6m_upcr
    Imputation method logreg is for categorical data.

logreg expects a factor, but remission_6m_upcr and remission_6m_egfr are stored as integer. This works in practice but is fragile. The cleaner approach is to store them as factors from the start:

    dat_imp <- dat0 %>%
      mutate(
        remission_6m_upcr = factor(remission_6m_upcr),
        remission_6m_egfr = factor(remission_6m_egfr)
      )

2. The "13 element …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by irenerlover
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants