Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: tidyLPA, multiply imputed data, and with() #186

Open
jrcalabrese opened this issue Dec 22, 2021 · 2 comments
Open

Feature request: tidyLPA, multiply imputed data, and with() #186

jrcalabrese opened this issue Dec 22, 2021 · 2 comments
Labels

Comments

@jrcalabrese
Copy link

Hello, I am interested in running latent profile analysis with multiply imputed data. I have conducted multiple imputation with the mice package, but combining with and estimate_profiles results in an error message: Error in df[, select_vars, drop = FALSE] : incorrect number of dimensions. I have included a sample below. I understand that this is likely a mice issue as much as it is a tidyLPA issue, but I would appreciate any ideas or suggestions. Thank you for your help.

library(tidyverse)
library(tidyLPA)
library(mice)
set.seed(123)

data(airquality)

imp <- mice::mice(airquality, 
                  m = 5, maxit = 5,
                  print = FALSE)

est_imp <- with(imp, 
            estimate_profiles(imp, n_profiles = 3, 
                              variances = "equal", 
                              covariances = "equal"))
#> Error in df[, select_vars, drop = FALSE]: incorrect number of dimensions
@cjvanlissa
Copy link
Collaborator

There is no straightforward way to integrate latent profiles across imputed datasets, that's very much an open area of research.
I would direct you to tidySEM, which can accommodate missing data through FIML (note that rows with all missing must still be deleted). The tidySEM function is mx_profiles(). It's less well documented than tidyLPA though.

@cjvanlissa
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants