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

By *tbates*

Created *08/09/2009 - 10:03*

Sun, 08/09/2009 - 10:03 — tbates [1]

The code below grabs the first 6 variables from myFADataRaw as manifest, but then provides the full n=9-variable covariance matrix to the mxModel

It runs, and gives no warning that half the variables are not modelled. Would be very helpful to say

"variables x-y are included in the covariance matrix, but do not appear in your model!"

or something similar?

########## reduction ##########

require(OpenMx)

data(myFADataRaw); myData = myFADataRaw;

manifests = names(myData)[1:6] # Just the first 6

#[1] "x1" "x2" "x3" "x4" "x5" "x6"

latents = c("G")

factorModel = mxModel(

"One Factor", type="RAM",

manifestVars = manifests,

latentVars = latents,

mxPath(from = latents, to=manifests),

mxPath(from = manifests, arrows=2),

mxPath(from = latents , arrows=2, free=F, values=1.0),

mxData(cov(myData), type="cov",numObs=500)

)

summary(mxRun(factorModel))

...

name parameter estimate error estimate

1

2

3

4

5

6

7

8

9

10

11

12

Observed statistics: 45

Estimated parameters: 12

Degrees of freedom: 33

AIC:

BIC:

adjusted BIC:

RMSEA:

**Links:**

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

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

[3] http://openmx.psyc.virginia.edu/thread/40-means-vector-mxdata-row-matrix-or-column-matrix

[4] http://openmx.psyc.virginia.edu/forums/openmx-developer-forums/r-functions-and-user-interface