Description Usage Arguments Details Value Examples
This function does very crude nonparametrical bootstrapping of a
fitted sem model using lavaan
.
1 | boot.lavaan(fitted.model, n)
|
fitted.model |
A model fitted by |
n |
Number of replications. |
Steps:
1. Fit a model normally using the arguments 'sample.cov' and 'sample.nobs' instead of 'data';
2. Get the sigma hat from the fitted model and build an empirical dataset with 'sample.nobs' observations;
3. Get 'sample.nobs' observations from this new dataset with replacement;
4. Fit a new model using the sample taken from the simulated dataset;
5. Repeat 3 and 4 'n' times.
X2 |
Bootstrapped maximum likelihood chi-squared |
p.X2 |
P value of the bootstrapped maximum likelihood chi-squared |
est |
Estimated coefficients |
se |
Bootstrapped standard errors |
z |
Bootstrapped z values |
p.est |
P values of the bootstrapped coefficients |
coefs |
Matrix with the values of all coefficients in all runs |
1 2 3 4 5 6 7 | ## Not run:
data(albert)
fit <- sem(albert.model, sample.cov = albert.litho.cov, sample.nobs
= 107)
booted.fit <- boot.lavaan(fit, 1000)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.