This is from BivariateSaturated_PathCov.R in the documentation
> bivSatModel1 <- mxModel("bivSat1",
+ manifestVars= selVars,
+ mxPath(
+ from=c("X", "Y"),
+ arrows=2,
+ free=T,
+ values=1,
+ lbound=.01,
+ labels=c("varX","varY")
+ ))
Error: The model type of model 'bivSat1' does not recognize paths.
any help?
greg
Hmm, the version in the repository looks like this:
The important argument to the mxModel() funciton is type="RAM" which creates a RAM model. Paths must be added to RAM type models.
strongly suggest that this be documentation be adjusted to note this fact. the following contains the relevant sections for "type" in the documentation to mxModel. there is no mention that type=RAM must be specified with mxPath.
type character vector. The name of the model type to assign to this model.
The model type is determined by a character vector supplied to the ‘type’ argument. The type of a model is a dynamic property, ie. it is allowed to change during the lifetype of the model. To see a list of available types, use the mxTypes command. When a new model is created and no type is specified, the type specified by options("mxDefaultType") is used.
To be estimated, MxModel objects must include objective functions as arguments (mxAlgebraObjective, mxFIMLObjective, mxMLObjective or mxRAMObjective) and executed using the mxRun function. When MxData objects are included in models, the 'type' argument of these objects may require or exclude certain objective functions, or set an objective function as default.
For my money, I would say that in this case it would be sensible for mxModel to automagically (aka by default) set the Type="Ram" argument because paths are clearly involved. This would save users - novice and expert alike - time.
Sounds good - unless there is another path model, like lisrel...
Perhaps the thing would be to make type=ram the default whenever type is not set.