Published on *OpenMx* (http://openmx.psyc.virginia.edu)

By *tbates*

Created *11/22/2009 - 20:29*

Sun, 11/22/2009 - 20:29 — tbates [1]

hi,

I think this model should run successfully.

# Fig2.12 from John Loehlin edition 4, p85

require(OpenMx)

# Get the data

names = c("A","C","D")

data=matrix(c(1, .3, .4, .3, 1, .35, .4, .35, 1), nrow=3, byrow=TRUE, dimnames=list(r=names, c=names))

# Get the manifest variable names from the data

manifests = row.names(data)

# Latents (in this case just B)

latents = c("B")

# Describe the model

model = mxModel("prob2-12", type="RAM",

manifestVars = manifests,

latentVars = latents,

mxPath(from = "A", to="B"), # factor loadings

mxPath(from = "B", to= c("C", "D") ), # factor loadings

mxPath(from = c("B", "C", "D"), arrows=2), # residual variances

mxData(data, type="cov",numObs=100)

)

# Run the model and save the fit

fit = mxRun(model)

# Running prob2-12

# Error: The job for model 'prob2-12' exited abnormally with the error message: Backing out of parameter space region where expected covariance is non-positive-definite.

# Output the summary

summary(fit)

# expecting a->b = .5855; b->c = .5223; b->d = .6831

**Links:**

[1] http://openmx.psyc.virginia.edu/users/tbates

[2] http://openmx.psyc.virginia.edu/thread/287

[3] http://openmx.psyc.virginia.edu/thread/229

[4] http://openmx.psyc.virginia.edu/forums/openmx-help/openmx-general-help