boot.lavan: Nonparametrical bootstrapping of a SEM model fit by 'lavaan'.

Description Usage Arguments Details Value Examples

Description

This function does very crude nonparametrical bootstrapping of a fitted sem model using lavaan.

Usage

1
boot.lavaan(fitted.model, n)

Arguments

fitted.model

A model fitted by sem or cfa.

n

Number of replications.

Details

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.

Value

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

Examples

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)

stremo documentation built on Jan. 15, 2017, 7:33 p.m.