Create an mxModel
It creates a mxModel from a RAM object.
create.mxModel(model.name="mxModel", RAM=NULL, Amatrix=NULL, Smatrix=NULL, Fmatrix=NULL, Mmatrix=NULL, Vmatrix=NULL, data, intervals.type = c("z", "LB"), mx.algebras=NULL, mxModel.Args=NULL, mxRun.Args=NULL, var.names=NULL, suppressWarnings=TRUE, silent=TRUE, run=TRUE, ...)
model.name |
A string for the model name in |
RAM |
A RAM object including a list of matrices of the model
returned from |
Amatrix |
If |
Smatrix |
If |
Fmatrix |
If |
Mmatrix |
If |
Vmatrix |
A V-known matrix of the variables. If it is specified, it
will be added into the |
data |
A data frame or matrix of data. Alternatively, users may
provide a |
intervals.type |
Either |
mx.algebras |
A list of |
mxModel.Args |
A list of arguments passed to |
mxRun.Args |
A list of arguments passed to |
var.names |
If it is |
suppressWarnings |
Logical. If it is |
silent |
Logical. An argument is passed to |
run |
Logical. If |
... |
Not used yet. |
An object of class mxModel
Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>
## Not run: ## Generate data set.seed(100) n <- 100 x <- rnorm(n) y <- 0.5*x + rnorm(n, mean=0, sd=sqrt(1-0.5^2)) my.df <- data.frame(y=y, x=x) ## Regression model model <- "y ~ x # Regress y on x y ~ 1 # Intercept of y x ~ 1 # Mean of x" plot(model) RAM <- lavaan2RAM(model, obs.variables=c("y", "x")) my.fit <- create.mxModel(RAM=RAM, data=my.df) summary(my.fit) ## A meta-analysis model <- "yi ~~ tau2*yi yi ~ mu*1" RAM <- lavaan2RAM(model, obs.variables=c("yi")) ## Create a v-known matrix Vmatrix <- as.mxMatrix("0*data.vi", name="Vmatrix") my.fit <- create.mxModel(RAM=RAM, Vmatrix=Vmatrix, data=Hox02) summary(my.fit) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.