sem(model = NULL, data = NULL,
meanstructure = "default", fixed.x = "default",
orthogonal = FALSE, std.lv = FALSE,
parameterization = "default", std.ov = FALSE,
missing = "default", ordered = NULL,
sample.cov = NULL, sample.cov.rescale = "default",
sample.mean = NULL, sample.nobs = NULL,
ridge = 1e-05, group = NULL,
group.label = NULL, group.equal = "", group.partial = "",
group.w.free = FALSE, cluster = NULL, constraints = '',
estimator = "default", likelihood = "default", link = "default",
information = "default", se = "default", test = "default",
bootstrap = 1000L, mimic = "default", representation = "default",
do.fit = TRUE, control = list(), WLS.V = NULL, NACOV = NULL,
zero.add = "default", zero.keep.margins = "default",
zero.cell.warn = TRUE,
start = "default", verbose = FALSE, warn = TRUE, debug = FALSE)
model.syntax
for more information. Alternatively, a
parameter tabTRUE
, the means of the observed
variables enter the model. If "default"
, the value is set based
on the user-specified model, and/or the values of other arguments.TRUE
, the exogenous `x' covariates are considered
fixed variables and the means, variances and covariances of these variables
are fixed to their sample values. If FALSE
, they are considered
random, and the means, vTRUE
, the exogenous latent variables
are assumed to be uncorrelated.TRUE
, the metric of each latent variable is
determined by fixing their variances to 1.0. If FALSE
, the metric
of each latent variable is determined by fixing the factor loading of the
first indicator to 1.0."delta"
, the delta parameterization is used. If "theta"
,
the theta parameterization is used.TRUE
, all observed variables are standardized
before entering the analysis."listwise"
, cases with missing values are removed
listwise from the data frame before analysis. If "direct"
or
"ml"
or "fiml"
and the estimator is maximum likelihood,
Full Information MaxiTRUE
, the sample covariance matrix provided
by the user is internally rescaled by multiplying it with a factor (N-1)/N.
If "default"
, the value is set depending on the estimator and the
likelihood option: it is setNULL
(the default), all grouping levels are selected, in the
order as they appear in the data."loadings"
, "intercepts"
, "means"
, "thresholds"
,
"regressions"
,
TRUE
, the group frequencies are
considered to be free parameters in the model. In this case, a
Poisson model is fitted to estimate the group frequencies. If
FALSE
(the default), the group frequencies aremodel.syntax
for more information."ML"
for maximum likelihood, "GLS"
for generalized least
squares, "WLS"
for weighted least squares (sometimes called ADF
estimation), "ULS"
"wishart"
,
the wishart likelihood approach is used. In this approach, the covariance
matrix has been divided by N-1, and both standard errors and test
statistics are based on N-1.
If "logit"
,
a logit link is used for binary and ordered observed variables.
If "probit"
, a probit link is used. If "default"
,
it is currently set to "probit"
"expected"
, the expected information matrix
is used (to compute the standard errors). If "observed"
, the
observed information matrix is used. If "default"
, the value is
set depending on the estimator "standard"
, conventional standard errors
are computed based on inverting the (expected or observed) information
matrix. If "first.order"
, standard errors are computed based on
first-order derivatives. If "rob
"standard"
, a conventional chi-square test is computed.
If "Satorra.Bentler"
, a Satorra-Bentler scaled test statistic is
computed. If "Yuan.Bentler"
, a Yuan-Bentler scaled test statistic
is computed. I"Mplus"
, an attempt is made to mimic the Mplus
program. If "EQS"
, an attempt is made to mimic the EQS program.
If "default"
, the value is (currently) set to to "lavaan"
,
which is very clo"LISREL"
the classical LISREL matrix
representation is used to represent the model (using the all-y variant).FALSE
, the model is not fit, and the current
starting values of the model parameters are preserved."nlminb"
. See the manpage of
nlminb
for an overview of the control parameters.
A different op"WLS"
;
if the estimator is "DWLS"
, only the diagonal of this matrix will be
used. For a multiple group analysis, a list with a weight matrix
for each group. The elW
TRUE
, the other values of the
frequency table are adjusted so that TRUE
, give a warning if one or more cells
of a bivariate frequency table are empty."simple"
and "Mplus"
.
In the first
case, all parameter values are set to zero, except the factor loadings
(set to one), the variances of latent variablesTRUE
, the function value is printed out during
each iteration.TRUE
, some (possibly harmless) warnings are printed
out during the iterations.TRUE
, debugging information is printed out.lavaan
, for which several methods
are available, including a summary
method.sem
function is a wrapper for the more general
lavaan
function, using the following default arguments:
int.ov.free = TRUE
, int.lv.free = FALSE
,
auto.fix.first = TRUE
(unless std.lv = TRUE
),
auto.fix.single = TRUE
, auto.var = TRUE
,
auto.cov.lv.x = TRUE
,
auto.th = TRUE
, auto.delta = TRUE
,
and auto.cov.y = TRUE
.lavaan
## The industrialization and Political Democracy Example
## Bollen (1989), page 332
model <- '
# latent variable definitions
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + a*y2 + b*y3 + c*y4
dem65 =~ y5 + a*y6 + b*y7 + c*y8
# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'
fit <- sem(model, data=PoliticalDemocracy)
summary(fit, fit.measures=TRUE)
Run the code above in your browser using DataLab