data(cardinale)
summary(cardinale)
model.card <- '
PatchDiversity ~ logNutrient + logNutrient2 + StreamDiversity
Biomass ~ PatchDiversity + logNutrient
O2Production ~ logNutrient + Biomass
logNutrient ~~ logNutrient2'
fit.card <- sem(model.card, data = cardinale, fixed.x = FALSE, estimator = "MLM")
des.card <- svydesign(ids = ~Stream, probs = ~1, data = cardinale)
fit.card.survey <- lavaan.survey(fit.card, des.card, estimator = "MLM")
pval.pFsum(fit.card.survey, survey.design = des.card)
Run the code above in your browser using DataLab