OpenMx General Help

Posted on
No user picture. JWiley Joined: 03/25/2011

non-independent submodels

I am still getting used to OpenMx, so this may be a stupid question. Say I have a single factor ("G") measurement model, in a mxModel object called "mMeasure". Is it now possible to use the mMeasure object as part of a structural model? I imagine something like (pseudocode):

mStructure <- mxModel("Structure",
manifestVars = "Y", latentVars = "G",
mxPath(from = "G", to = "Y"),
## other model stuff)

mFull <- mxModel("Overall",
type = "RAM",
mxData(mydata[, c("all", "manifest", "variables", "for any submodel")], type = "raw"),
mMeasure,
mStructure)

Posted on
Picture of user. tbates Joined: 07/31/2009

Handy R tips

Put your UI- and R-tips here.
Posted on
Picture of user. neale Joined: 07/31/2009

Accessing MxModel objects by other than name

So I am familiar with being able to refer to an MxModel object, and in particular its objective function, by name, thusly:

algObj <- mxAlgebra(-2*sum(log(classProbs[1,1]%x%Class1.objective + classProbs[2,1]%x%Class2.objective)), name="mixtureObj")

Posted on
Picture of user. kspoon Joined: 06/17/2011

Confidence Intervals for Univariate Ordinal ACE Model with 2 Thresholds

I was wondering if there was a reason I can't seem to get confidence intervals for an ordinal ACE model with 2 thresholds.

I made sure to specify the mxCI for my standardized variance components call in my model and to put the "intervals=T" in my mxRun line. In my model fit $output$confidenceIntervals exists, but does not have any values.

Is this normal? If not, is there a way to create confidence intervals in the ordinal case? If it's just a silly code error, my code is below.

Any help would be appreciated!

univACEOrdModel <- mxModel("univACEOrd",
mxModel("ACE",

Posted on
No user picture. kkelley Joined: 08/04/2009

Specifying the Correlation Among all Exogenous Variables

Hello,

I was wondering if there is an easy way to tell OpenMx to estimate all of the correlations among a set of exogenous variables, rather than specifying each of the correlations line-by-line in mxPath statements.

For example, suppose exogenous variables are:
IVs <- c("COREREL", "JOBPAY", "SEX_2")

I tried to automate a way to include the exogenous correlations for an arbitrary number of variables as:

These.Pairs <- combn(IVs, 2)
Here <- NA
for(i in 1:dim(These.Pairs)[2])
{

Posted on
No user picture. a.ortega Joined: 02/05/2011

OpenMx script for twin data to parallelize

Hi!
I have a script for ordinal twin data that takes about 5-6 hours to compute in my laptop. I was wondering whether it would be beneficial in this particular case to parallelize the work in order to reduce the computational time. Would it be possible to adapt this script to do the job?

I have been reading the OpenMx notes in the manual to implement the parallelization with the "Snowfall" package, but they seemed a bit odd to me (I have not too much experience in parallelizing with R). Any indication would be very appreciated. I attach here the script if somebody wish to have a look.

Posted on
No user picture. EDG Joined: 06/03/2011

How does SEM computational complexity in OpenMx scale with sample size?

Sorry if this is a question that is answered elsewhere, but does anyone know how the time to compute a full SEM in OpenMx scales with the number of subjects that are used?

Thanks!

Posted on
No user picture. dchackett Joined: 05/19/2011

Issue with indexing in MxMatrix

So, given an mxMatrix, testMatrix, with values:

@values
X Y G
X 1 2 3
Y 4 5 6

Then:
testMatrix[c('X'), c('X', 'G')]
yields:
@values
[,1]
X 1
G 3

Posted on
Picture of user. carey Joined: 10/19/2009

summary(MxModel) object

trying to put OpenMxGUI into a package, i ran into a problem with the object from summary(MxModel). for some reason, the object is of class "summary.mxmodel" when all of OpenMxGUI is input using source(). in the package, however, the object is of class "table."

this is what i get when i read in the code using "source" and run the model:
> head(summary(thisOMxModel)$parameters)
name matrix row col Estimate Std.Error
1 sqrtStdE 1 1 1.9426018 0.05663194
2 sqrtStdE 2 2 2.1226024 0.08699889
3 sqrtStdE 3 3 1.8922519 0.06716601

Posted on
No user picture. jlisic Joined: 04/13/2011

Derivation of the Saturated Model Likelihood result.

Hi, I've been playing a bit around with SEM models and open-mx and I am having some trouble with derivation of the 'saturated -2 log likelihood' output provided by the summary screen.

Shouldn't the Saturated model be zero always except for some machine error? Instead it tends to be fairly close to a model with 1 degree of freedom.

I might be misunderstanding something but for the saturated model where the Implied model under this condition is equal to the Sample covariance matrix which should yield a discrepancy function of zero.