Definition variables, use rows outside of MxData
Posted on
Leo
Joined: 01/09/2020
Forums
Hey,
I'm unsure if I understood the concept of definition variables right. So I have an ordinal manifest and I would like to add covariates that are calculated outside of mxData which I use to calculate the models (i.e. covariates are calculated using a bigger sample, but only a smaller sample is used for analysis). With continuous variables, I would know how do it (simply performing a linear regression beforehand with the bigger sample and only using the residuals in the actual analysis with the smaller sample). How can I do this with definition variables? Or is it even possible?
Thanks in advance!
P.S. I'm using path specification
Hi Leo,
Definition variables don't work exactly the way you think they do, but I think they can help you with your problem. Definition variables are observed variables that you think affect the structure of your model and the relationships between other variables. You can use these to do regression as you describe, but they have lots of other uses, including the use of zygocity or time variables as shown in the documentation. I'm happy to describe extended uses if of interest.
OpenMx doesn't have an easy way for your sample size to change part of the way through your analysis, but it does have excellent missing data handling. Why are you trying to work with two different sample sizes? If it's because you're missing data on a key variable in your second analysis, that's typically not a problem (conditional on your missing data mechanism).
For example, let's consider a covariate C, a predictor X, and an outcome Y. You're missing data on Y, and want to find the effect of X on Y controlling for C. You're proposing a two-step analysis:regress X on C, get residuals, then do a second regression of residualized X on Y for people with both variables. However, in OpenMx, you can just put all three variables in the same model, fit a multiple regression where C and X covary and both predict X, and OpenMx will use all available data for each part of the analysis.
Would that work for your problem?
Log in or register to post comments
Hi Ryne. Thank you for your
Log in or register to post comments
In reply to Hi Ryne. Thank you for your by Leo
If your trying to test
Log in or register to post comments
Hi Ryne,
I have already done that. The second wave does differ in A, C and E. I am thinking more about the following: As there is some variation of the time of measurement (2014-2018), I was thinking if that could be analyzed continuously, even maybe on a monthly basis so I end up with a graph that looks very similarly to GxE graphs? I am thinking about: year of measurement moderates the phenotype (after controlling for age!). Or: age moderates the phenotype, after controlling for year of measurement.
Log in or register to post comments
In reply to Hi Ryne, by Leo
You could do that. A lot
Log in or register to post comments