powered by
lavaan
boot.lavaan(fitted.model, n)
sem
cfa
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.
## 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)
Run the code above in your browser using DataLab