Learn R Programming

MLMusingR (version 0.4.0)

mixPV: Fit Weighted Multilevel Models Using Plausible Values

Description

Helper function to fit multilevel models with plausible values using weights at different levels using the mix function from the WeMix package (Bailey et al., 2023): see https://cran.r-project.org/web/packages/WeMix/WeMix.pdf.

Usage

mixPV(fml, data = NULL, mc = FALSE, silent = FALSE, ...)

Value

A list object of mix results. Results are pooled using the summary function.

Arguments

fml

The model formula. Multiple plausible values are specified using the form: pv1 + pv2 + pv3 ~ x1 (depending how many PVs are present).

data

Merged dataset to analyze (containing variables at different levels).

mc

Option to use multiple cores to speed up processing (set to FALSE by default).

silent

Option to show which plausible value is being analyzed (set to FALSE by default).

...

Options that are used by the mix function in the WeMix package.

Author

Francis Huang, huangf@missouri.edu

References

Huang, F. (2024). Using plausible values when fitting multilevel models with large-scale assessment data using R. Large-scale Assessments in Education, 12(7). (link)

Examples

Run this code
if (FALSE) {
data(pisa2012, package = 'MLMusingR')
m1 <- mixPV(pv1math + pv2math + pv3math + pv4math + pv5math ~ escs + (1|schoolid),
weights = c('w_fstuwt', 'w_fschwt'), data = pisa2012)
summary(m1)
}

Run the code above in your browser using DataLab