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

unable to run model with non-overlapping planned missingness #238

Open
khusmann opened this issue Dec 19, 2023 · 0 comments
Open

unable to run model with non-overlapping planned missingness #238

khusmann opened this issue Dec 19, 2023 · 0 comments

Comments

@khusmann
Copy link
Contributor

Hello! I'm trying to run an EFA with planned missingness. The challenge is that the missing pattern is such that there are no complete observations:

library(umx)

example_data <- data.frame(
  item1 = rnorm(90),
  item2 = rnorm(90),
  item3 = rnorm(90),
  item4 = c(rnorm(30), rep(NA, 60)),
  item5 = c(rep(NA, 30), rnorm(30), rep(NA, 30)),
  item6 = c(rep(NA, 60), rnorm(30))
)

umxEFA(example_data, factors=1)

Running this fails on umx_var. Here's the error & traceback():

A latent variable 'F1' was created. 
Error in var(df, use = use) : no complete element pairs

6: var(df, use = use)
5: umx_var(data, format = "diag")
4: xmu_check_variance(data[, setdiff(namesNeeded, fullCovs), drop = FALSE])
3: xmu_make_mxData(data = data, type = type, verbose = verbose)
2: umxRAM(model = name, data = data, autoRun = FALSE, umxPath(factors, 
       to = manifests, connect = "unique.bivariate"), umxPath(v.m. = manifests), 
       umxPath(v1m0 = factors))
1: umxEFA(example_data, factors = 1)

Running umx_var(example_data) confirms the error; looks like it's called to compute starting values.

Is there a way we can either 1) create starting values without complete obs, or 2) pass our own starting values to bypass this error?

Thanks for taking a look at this!


Here's my umx version info, for completeness:

umx version: 4.19.0
OpenMx version: 2.21.8 [GIT v2.21.8]
R version: R version 4.2.2 (2022-10-31)
Platform: x86_64-conda-linux-gnu
Default optimizer: SLSQP
NPSOL-enabled?: No
OpenMP-enabled?: Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant