Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

analyze

Data analysis using the model specification


Description

Data analysis using the model specification (linkS4class{SimSem}) or the mx model object (MxModel). Data will be multiply imputed if the miss argument is specified.

Usage

analyze(model, data, package="lavaan", miss=NULL, aux=NULL, group = NULL, 
	mxMixture = FALSE, ...)

Arguments

model

The simsem model template (linkS4class{SimSem}) or the mx model object (MxModel)

data

The target dataset

package

The package used in data analysis. Currently, only lavaan package can be used.

miss

The missing object with the specification of auxiliary variable or the specification for the multiple imputation.

aux

List of auxiliary variables

group

A group variable. This argument is applicable only when the model argument is a MxModel object.

mxMixture

A logical whether to the analysis model is a mixture model. This argument is applicable when MxModel is used in the model argument only.

...

Additional arguments in the lavaan function. See also lavOptions

Value

The lavaan object containing the output

Author(s)

Patrick Miller (University of Notre Dame; pmille13@nd.edu), Sunthud Pornprasertmanit (psunthud@gmail.com)

See Also

Note that users can use functions provided by lavaan package (lavaan, cfa, sem, or growth) if they wish to analyze data by lavaan directly.

Examples

loading <- matrix(0, 6, 2)
loading[1:3, 1] <- NA
loading[4:6, 2] <- NA
LY <- bind(loading, 0.7)

latent.cor <- matrix(NA, 2, 2)
diag(latent.cor) <- 1
RPS <- binds(latent.cor, 0.5)

RTE <- binds(diag(6))

VY <- bind(rep(NA,6),2)

CFA.Model <- model(LY = LY, RPS = RPS, RTE = RTE, modelType = "CFA")

dat <- generate(CFA.Model,200)
out <- analyze(CFA.Model,dat)

simsem

SIMulated Structural Equation Modeling

v0.5-16
GPL (>= 2)
Authors
Sunthud Pornprasertmanit [aut], Patrick Miller [aut], Alexander Schoemann [aut] (<https://orcid.org/0000-0002-8479-8798>), Terrence D. Jorgensen [aut, cre] (<https://orcid.org/0000-0001-5111-6773>), Corbin Quick [ctb]
Initial release
2021-03-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.