nlminb
.
sem
in lavaan
and does not handle equality
constraints, multiple groups and intercepts. We made this to aid those who
are learning SEM to understand the very basics of the technique.
Please refer to lavaan
for more serious usage.
fit.nlminb(model, sigma, n, fun = "fml")
The first thing this function does is to call lavaan to get a good set
of starting values for the parameters to be estimated and use lavaan's
internal representation of a SEM model as a starting point. After that, the
chosen function calls an optimiser, nlminb
, which will try to converge to a
solution given a set of parameter estimates and a population
covariance matrix. Then, it will try to calculate standard errors from
the Hessian matrix, z-values for each estimate and its correspondent
p-values. The next step is to calculate the fit of the model to,
finally, build a response.
sem
in lavaan
is much faster and converges to a
unique solution more frequently. It can also handle a much more
diverse range of models, including those with multiple groups,
equality constraints, growth models and so on.
## Not run:
# data(albert)
# cat(albert.model)
# fit <- fit.nlminb(albert.model, albert.litho.cov, 107)
# summary(fit)
# ## End(Not run)
Run the code above in your browser using DataLab