OpenMx Structural Equation Modeling
psunthud
Joined: 02/14/2012
Finding likelihood-based confidence interval when a matrix contains definition variables
Hi everyone,
I have a problem running multilevel model using a SEM framework to get a likelihood-based CI of the effect size. I have two factors representing (random) intercept and (fixed) slope. I attach my data file here. Use the following code to get the dataset:
datawide <- read.csv("datawide.csv")
The dataset has been transformed into a wide format. Y is the response variable. X is the upper-level predictor. Z is the lower-level predictor without any centering. My target model is
L1: Y = B_0 + B_1 * Z + r
L2: B_0 = X + u
rabil
Joined: 01/14/2010
mxRowObjective - Any Examples?
I would like to be able to handle Poisson counts. The only lead to doing this in OpenMx seems to involve using mxRowObjective. I was wondering if any one could share some examples.
- Read more about mxRowObjective - Any Examples?
- 1 comment
- Log in or register to post comments
rabil
Joined: 01/14/2010
Constraining Thresholds
I wrote a simple OpenMx script to do LCA on ordinal variables. It works fine on simulated data. When I run it on real data, the estimated thresholds are not in order. I then included constraints on the thresholds (simple enough to do) so that they are monotonically increasing. This seems to work as the threshold estimates monotonically increase. From reading the manual, I was sure constraints weren't necessary.
- Read more about Constraining Thresholds
- 4 comments
- Log in or register to post comments
rabil
Joined: 01/14/2010
Poisson Counts
I've asked about this before but I don't think I ever received any replies. Can OpenMx handle Poisson counts as observed variables? I have counts that are too small to treat as continuous Normally distributed outcomes and I need a way to model them. Any insights would be greatly appreciated.
- Read more about Poisson Counts
- 7 comments
- Log in or register to post comments
rabil
Joined: 01/14/2010
Is it possible to model censored data in OpenMx?
The data I have are censored at a value that is constant across all subjects. So y is Normal except that all values at or above 15 were coded as 15. I've created a simple LCA in OpenMx that works (treats the censored data as if it were simply Normal) but the censored data affect the detection of clusters. I'd like to model the data as truncated. I'm familiar with thresholds for ordinal data but it's not clear to me if OpenMx can handle truncated Normal data where y* = y if y <= 15 and y* = 15 if y > 15.
neale
Joined: 07/31/2009
Standardized Estimates
At a recent workshop, someone asked how to obtain standardized estimates from OpenMx. Using the path-style input this is straightforward, and can be done with a couple of mxEval() statements and an omxRAMtoML() call:
# Now standardize solution
mxEval((solve(vec2diag(sqrt(diag(S)))))%&%S,threeLatentMultipleReg1Out)
mlthreeLatentMultipleReg1Out<-omxRAMtoML(threeLatentMultipleReg1Out)
mxEval(solve(vec2diag(sqrt(diag(solve(I-A)%&%S))))%*%A%*%vec2diag(sqrt(diag(solve(I-A)%&%S))),mlthreeLatentMultipleReg1Out,compute=T)
- Read more about Standardized Estimates
- Log in or register to post comments
tbates
Joined: 07/31/2009
Fake Latents
Hi,
Snuffling around in MxPPMLR I see
# IN DEVELOPMENT
# Fake Latents
# There are multiple ways to specify the error variance terms. There is the
# usual, direct way of allowing the term in the S matrix to be free, but it
# can also be specified using latent variables.
#
# This segment adjusts the model so that all error variance is specified using
# only the S matrix, without any latent variables
This raised a question for me.
I guess this is designed to do change this:

Into this:
- Read more about Fake Latents
- 2 comments
- Log in or register to post comments
tbates
Joined: 07/31/2009
AIC etc in multi-group RAM models
hi all,
Running a 2 group RAM model. Both sub-models return their fit indices in summary(), and the supermodel runs fine, with a summed objective.
However... while the supermodel knows about the submodel's observations etc (as shown in the print out below) it doesn't compute an AIC for the the supermodel
Bug/Missing code?
observed statistics: 156
estimated parameters: 79
degrees of freedom: 77
-2 log likelihood: 46372.74
saturated -2 log likelihood: NA
number of observations: 6000
chi-square: NA
p: NA
Information Criteria:
- Read more about AIC etc in multi-group RAM models
- Log in or register to post comments
brauer
Joined: 01/28/2012
How to get the correlation residuals with the new version of OpenMx?
Hi,
I recently downloaded the most recent version of OpenMx. Since then I am no longer able to get the model-implied covariance matrix, and therefore, the correlation residuals. Before, the following script would get me the correlation residuals:
residuals <- cov2cor(covmatrix) - cov2cor(modelfit$objective@expCov)
round(residuals, digits=4)
My data are in "covmatrix", a symmetric covariance matrix. The result of the mxRun is stored in "modelfit")
tbates
Joined: 07/31/2009
RAM estimation from covariance matrix where ns differ per cell
hi all,
When mxData is a cov or cor matrix, numObs is just one number.
Quite often the cells in a covariance matrix could take advantage of different numbers of observations.
Two questions: has anyone made RAM models with an "numObs" matrix to give a per-cell n? And second, are the assumptions of a covariance-based model violated if all data do not come from complete subjects?
Pagination
- Previous page
- Page 7
- Next page