Hello,

I've done some univariate twin model analyses in OpenMx recently, but now I'm trying my hand at bivariate models.

I'm using a script by Hermine (http://ibg.colorado.edu/cdrom2016/maes/MultivariateAnalysis/mulACEc2.R).

So far I succeeded in running the model and obtaining indicators of fit and path loadings. But I've got a couple of questions:

1) However, the output I get does not produce viable 95%CI's (the model summary shows lbounds converging on zero and no ubounds). How can I obtain proper intervals around my path loadings?

2) And to answer my research question, about the influence of A, C, and E on the correlation between variables, I need the cross-trait within twin correlation, and the cross-trait cross-twin correlation. So far, I haven't been able to find these (but maybe they are in this script and I just read over them).

3) So far I've compared the satured model with models where A, C, and E are included for both variables, but I would also like to try models that include e.g. ACE for variable 1 and CE for variable 2, or CE for 1 and E for 2. Where can I find a script for such models?

Cheers,

Jizzo

Could you provide the actual output? Try running

`summary()`

on your fitted MxModel, with argument`verbose=TRUE`

. That will print the details of the confidence-limit solutions. There might not be anything wrong with the lower limits, but upper limits of`NA`

could indicate a problem. I've learned from experience that novice users are sometimes confused by CI results that are in fact correct (e.g., threads 4253, 3999, 3446).In any event, there are three reasons why a confidence limit would be displayed as

`NA`

. First, it could be equal to the point estimate, in which case it may actually be correct if the point estimate is is on a boundary of the feasible space (or is actually fixed, like a diagonal element of a correlation matrix). Second, it could be on the wrong side of the point estimate, such as an upper limit that is less than the point estimate, which is obviously wrong. Third, the corresponding change in -2logL from the MLE could differ too much from its target value (which for a 95% CI is about 3.841); in this case, the limit is wrong in that the resulting confidence interval is too narrow or too wide.You'll want to convert the model-expected MZ and DZ covariance matrices into correlation matrices. See here and here for suggestions.

You can modify the script you're using to selectively fix the appropriate path coefficients to zero, with

`omxSetParameters()`

. For instance, to fit a model that has ACE for the first trait and CE for the second, fix to zero the [1,2] and [2,2] elements of the "A" path-coefficient matrix. In your case, the command is probably something like`omxSetParameters(fitACE, labels=c("a12","a22"), free=FALSE, values=0)`

.First of all, thanks for your comments.

1) The output for the ACE model is as follows:

2) I got the correlation matrix alright.

3) Thanks, no further questions.

4) New issue:

The best fitting model we used (so far) was a CE model, with the following path loadings:

C1 --> Var1 0.5674

C1 --> Var2 0.2017

C2 --> Var2 0.1838

E1 --> Var1 0.8234

E1 --> Var2 -0.0098

E2 --> Var2 0.9620

This negative path loading troubles me..

More so, because I need this to calculate to what extent C and E explain the variance in the correlation.

With a cross-trait, within-twin correlation of 0.1083, this leads to impossible proportions of explained variance.

C [ 0.5674 * 0.2017 ] / 0.1083 = 1.06

E [ 0.8234 * -0.0098] / 0.1083 = -0.07

1) Concerning the output--confidence-interval results appear in a separate table from the "free parameters" table. The "lbound" and "ubound" columns of the "free parameters" table contain the lower and upper boundaries on the allowed range of the free parameters. Confidence intervals aren't automatically calculated. Are you including an MxInterval object (such objects are created with

`mxCI()`

) in your MxModel, and passing argument`intervals=TRUE`

to`mxRun()`

?4)

Basically, the interpretation of those quantities as proportions comes apart if any of the components that sum to the phenotypic correlation are negative. You are not the first person to be confused when this happens, which I think reflects a shortcoming in how twin modeling is typically taught.

1) Thanks for the comment. With input from other forum posts, I have updated my model to include

Bit of a formatting error there, my question is:

This does provide me with intervals in the output as intended. However, the output I am mostly interested in are the ACE Standardized Path Coefficients (pre-multiplied by inverse of standard deviations) and the squared standardized path coefficients. Now the next step would be to obtain the 95%CI's around the standardized and squared standardized coefficients, but I can't quite figure this out.

It's hard to make specific suggestions without seeing the script you're currently working from, but the simple answer is to include in

`mxCI()`

argument`reference`

the names of the MxAlgebra objects that contain the standardized and squared standardized path coefficients, e.g.or whatever the case may be. Note that

`mxCI()`

requires the MxAlgebras'names(i.e., the character strings provided to argument`name`

of`mxAlgebra()`

), andnottheir R symbols (i.e., the thing to the left of assignment operator`<-`

in your syntax).I don't know whether you've put 'ciACE' into the "container" MxModel or into one of its submodels ("groups"), so if the algebras for the standardized coefficients are in a submodel but 'ciACE' is in the container model, you might have to prefix the MxAlgebra names with the name of the appropriate submodel--say,

`"MZ."`

(for instance,`"MZ.stdPathA"`

), or whatever the case may be.If you do an advanced Content search of the OpenMx website, for forum topics containing the phrase "confidence intervals", you might find additional hints or illustrative examples.

Beneath is the full syntax I'm currently using, which results in an error:

"Error: Unknown reference to 'stdPathA' detected in a confidence interval specification in model 'mulACEc'

You should check spelling (case-sensitive), and also addressing the right model: to refer to an algebra

See help(mxCI) to see how to refer to an algebra in a submodel. FYI, I got as far as: runHelper(model, frontendStart, intervals, silent, suppressWarnings, unsafe, checkpoint, useSocket, onlyFrontend, useOptimizer)"

So what I'm trying to obtain is the 95% CI's around the standardized and squared standardized path coefficients. And if possible, also 95% CI's around the between-twin and cross-twin correlations (final two lines of script).

Script:

Try adding this syntax to your script, starting at line #118 (right after object 'estVC' is defined):

Great, thanks. This at least does provide the intervals I want in my output.

However, for many of the CI estimates, I get NA's.

Using the option verbose=T, results in a lot of 'active box constraint' diagnostics, and some 'alpha level not reached':

CI details: (excerpt)

I might help if you post the full output of

`summary()`

with`verbose=T`

, preferably as a text-file attachment to your reply post (for the sake of readability). While you're at it, your full script might help, too.The "active box constraint" diagnostic is advising you that the solution for that confidence limit is close enough to at least one box constraint (in your case, an 'lbound' on the free parameter) that the confidence-limit estimate may not be trustworthy. See if the change in fit between the MLE solution and that confidence-limit solution is around 3.841 (for a 95% interval); if it is, then the confidence interval is reliable in spite of the boundary.

BTW, could you confirm that you're using SLSQP as the optimizer, as your script implies?

I do have to ask why there are lbounds on all of the variance-covariance parameters in your model in the first place. If there's no good reason to have them, then you could get rid of them, either by editing your script (which provides lbounds in

`mxMatrix()`

statements) or by appropriate use of`omxSetParameters()`

on your assembled ACE model.Since you're running OpenMx v2.7.11, an alternative to profile-likelihood CIs is bootstrap CIs. See the help page for

`mxBootstrap()`

. If you update to v2.7.12 or newer, you'll be able to use several additional utility functions related to bootstrapping. N.B. that the default coverage probability of bootstrap CIs is 50%. If you increase it. to 95% (via argument`boot.quantile`

to`summary()`

) definitely increase the number of replications toat least1000.I was mistaken about this:

See my other post here.

wow, lots of useful information. i had a question to ask but i found my answer here throughout your answers. would you mind if i am going to ask some other questions if i am going to have in the future in regards to bivariate twin model? please?

Sure, feel free to ask your questions. But, if they're about pretty different stuff from what's in this thread, then you might want to post a new thread of your own.