Attachment | Size |
---|---|
![]() | 8.2 KB |
Hello,
I have a question regarding the Direction of Causation (DOC) model. I have found a very useful script at the following link and I'm trying to modify it according to my dataset: http://ibg.colorado.edu/cdrom2016/verhulst/Causation/DOC%20student.R.
I have 2 observed variables (x and y, both continuous) and I would like to verify if their association is causal (i.e. if x causes y. The inverse direction is not possible as x comes before y).
I have attached the modified script for you to have a look. When I run the Cholesky and the DOC models, I get this error:
"Error: Unknown expected covariance name 'expCovMZ' detected in the expectation function of model 'MZ'".
I suppose the problem is in the factor loadings function, but I can't fix it (probably because I'm not sure I understand what 'factor loadings' are). Can anyone help me?
Also, I would like to further modify this script in order to 1) control for a few confounding factors (of which only one- sex- can vary between co-twins) and 2) to control for the effect of a moderator (which does not vary between co-twins and is continuous) on the x variable only. Is it possible? Any suggestions will be much appreciated!
Thank you so much for your help!
Elena
These lines:
seem to lack the expected covariance matrices desired. The MZ and DZ objects should at least include
But even more needs to be added... you can see how my debugging was plodding along with these steps:
I am not sure why such a badly broken script is on the website, I'll ping Brad about it. With respect to adding covariates, that is certainly possible but I am not aware of such scripts. I would perhaps use umx to build a similar model without causal paths, then add them in, at least until such time as direction of causation models are added to umx - which I hope will be later this year, Dr. Bates willing...