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

Make possible to use umx sketch mode with umxTwinMaker #180

Open
lf-araujo opened this issue Dec 17, 2021 · 1 comment
Open

Make possible to use umx sketch mode with umxTwinMaker #180

lf-araujo opened this issue Dec 17, 2021 · 1 comment

Comments

@lf-araujo
Copy link
Contributor

lf-araujo commented Dec 17, 2021

While modifying the function for DoC I found out umxTwinMaker, which is such a handy tool when you already have data.

But if you are exploring and don't have data to match a twin model that is complex enough so that it would be easier to generate the paths for one person and get the supermodel with TwinMaker, you have no luck:

mtwin <- umxTwinMaker(
  paths = paths, sep = "_T",
  t1_t2links = list("A1" = c(1, .5), "C1" = c(1, 1), "E1" = c(0, 0), "A3" = c(1, .5), "C3" = c(1, 1), "E3" = c(0, 0))
)

Errs with:

Error: In umxRAM, you must set 'data = '. If you're building a model with no data, use mxModel
  • Would it be possible to get twinmaker to return a model without trying to run it?

My attempt:

I edited TwinMaker so it now reads:

    MZ = umxRAM("MZ", c(Twin1Paths, Twin2Paths), data = vars,
        autoRun = FALSE)
    DZ = umxRAM("DZ", c(Twin1Paths, Twin2Paths), data = vars,
        autoRun = FALSE)

so I can pass a list of observed (vars), and:

    model = umxSuperModel(name, MZ, DZ, autoRun = F)

And it runs as expected, but later on when I then try to generate data for the supermodel with:

mtwin <- mxGenerateData(model = mtwin, 1000, empirical = T, returnModel = T)

I get Error in eigen(Sigma, symmetric = TRUE) : 0 x 0 matrix, but I can't find where in the code the function loses track of the sigma matrix.

@tbates
Copy link
Owner

tbates commented Dec 17, 2021

The problem is that for this to be useful, the user then needs to set all the parameter values. Easier said than done with a complex model. But still …easier if umxTwinMaker could at least press on when no data are provided and give the user a model they can take to the final stage for inputting to umxGenerate data.

I'll mull it over over the weekend.

Thanks for all your engagement and the excellent need-driven suggestions - they are lovely to receive!

T

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

2 participants