Hi all,
I have a question about covariates/definition variables. I have noticed that in most of the scripts (Boulder workshop) covariates are included as definition variables (also in GxE models). I just wondered if covariates could be included as manifest(measured) variables and a regression path with the studied phenotype. I know both methods should be equivalent but this would allow to include missing values. Is there any reason/advantage for including covariates always as definition variables?
I have read the OpenMx user guide and the examples about how to fit a regression but I am not sure if this is related about the way to fit the models (path vs matrix). I guess the matrix specification is easier as compared to the path specification.
Thank you so much in advance!
With all good wishes
When you use a definition variable as a covariate you are assuming complete exogeneity for that variable. That is, you make no distributional assumptions about the definition variable; the definition variable is measured without error; missing data is not allowed for that variable.
When you use a manifest variable as a covariate you are assuming endogeneity. That is, you assume the covariate is part of multivariate normal distribution with all the other manifest variables; the covariate might be measured with error; missing data is handled via full information maximum likelihood.
If you use the same variable as both a definition variable and a manifest variable, you are apply the exogeneity assumptions for the definition variable uses and the endogeneity assumptions for the manifest variable uses.
As a side note, many of the regression examples for OpenMx make the endogeneity assumption; whereas classic ordinary least squares regression makes the exogeneity assumption for all predictors. When the data are multivariate normal, this doesn't matter much, but there is a technical difference between these.
Hi Mike,
This is really helpful! Thank you so much for your great response.
I am trying to add a covariate (manifest) to an ACE model, but I have not been able to do it. Are you aware of any ACE script with a covariate as a manifest variable?
I have tried by adding this part from the OpenMx User guide:
and adding b1 to the ExpMean
but I am not able to make it work. Should I remove the residual variance? I am also not sure if I should use
mxExpectationRAM()
. Any guidance would be greatly appreciated.Thank you so much in advance.
With all good wishes!
Hi again,
I have been working on this and I have fitted these two models:
First Model
Second model
I guess the second one is the correct one, but I am not sure. Is the second one first subtracting all the variance due to Age? And then partitioning the remaining variance into A, C and E?
Thank you so much!
Hi
There are more direct and easier ways to do what you do - see response from Prof. Maes. I note some issues with the specification that you have been trying to use.
This seems to assume that the covariance between age and the phenotypes of the twins should be zero. But if Age is causing some variation in the phenotype, their covariance will typically not be zero. The covariance between age and phenotype should be betaAge * var(Age) - from rules of path analysis, where age has variance parameter var(Age) and the regression of the phenotype on Age is betaAge. The added variation of betaAge^2 times var(Age) affects both twin 1 and twin 2's phenotypic variances and their covariance. This is the case for both MZ and DZ pairs - which is why variance due to Age mimics that due to C. Indeed, adding the variance due to age to C would be one way to implement the model.
Hello,
this comment makes some points to me more clear and I have a question on that. I do specify a single-factor model with 5 indicators and a definition variable. I would like to regress the latent factor on a manifest variable (which is no definition variable). My model is build by specifying different matrices and matrix algebra equations (mxAlgebra) before I do run the model with ML (mxRun). My definition variable is "Age" and I do specify the matrix this way:
matV1 <- mxMatrix(type="Full", nrow=1, ncol=1,
free=FALSE,
labels="data.Age",
name = "Age")
However, I am not sure, how I could specify a simple manifest variable as a covariate (e.g., well-being) which predicts the latent factor in a separate matrix.
Any professional hint would be appreciated.
My model does look like this (attached file) where Age is a definition variable with effects on factor variances and means, respectivly. I have defined them this way:
I would like to integrate positive affect as a covariate and I am doint it this way:
However, when I run the model with further matrices (mxRun()), there is no SE for G2 (NA) and I get a value for Age2. I do not understand it and I am not sure, if I am doing something wrong. Can anyone explain me, what I am doing wrong?
Best
I think you'll need to provide your full script before anyone can answer your questions.
Sure, I can do this:
Everything works, except the panas variable
It is modScalar <- ... instead of modConfig <- ...
Based on your code it's hard for me to tell what you are trying to do. Consequently, I'm not sure if you're succeeding in your intention or not.
Does this model run? The way you're handling the age covariate in this model is unfamiliar to me.
Dear Mike,
Thank you so much for your help with this. I just want to add age as a covariate (manifest variable) but I am struggling to do it.
Here you can see my code with some simulated data. I hope this makes things much easier.
The model runs OK and the estimates for the variance due to age match (25%). However, the estimates for A, C and E are not reasonable (C should be 0?). And in the AE model there is no VE and all is VA.
Thank you so much!
I believe the script below does what you're attempting:
I also attach the corresponding path diagram:
Thank you so much, Hermine.
This is really helpful! I really appreciate it.
With all good wishes!