Learn R Programming

dcm2 (version 1.0.2)

fit_m2: Model Fit M2 Calculations

Description

Estimate the M2 statistic as described by Liu et al. (2016).

Usage

fit_m2(model, ci = 0.9, ...)

Value

A data frame containing:

  • m2: The M2 statistic

  • df: Degrees of freedom for the M2 statistic

  • pval: p-value for the M2 statistic

  • rmsea: Root mean square error of approximation

  • ci_lower: Lower end of ci interval for RMSEA

  • ci_upper: Upper end of ci interval for RMSEA

  • srmsr: Standardized root mean square residual

Arguments

model

An estimated diagnostic classification model.

ci

The confidence interval for the RMSEA.

...

Unused, for extensibility.

References

Liu, Y., Tian, W., & Xin, T. (2016). An application of \(M_2\) statistic to evaluate the fit of cognitive diagnostic models. Journal of Educational and Behavioral Statistics, 41, 3-26. tools:::Rd_expr_doi("10.3102/1076998615621293")

Examples

Run this code
possible_prof <- dcm2::as_binary(ncol(sample_data$q_matrix))

fit_dat <- sample_data$data %>%
             tidyr::pivot_wider(names_from = "item_id",
                                values_from = "score") %>%
             dplyr::select(-"resp_id") %>%
             as.matrix() %>%
             unname()
gdina_mod <- GDINA::GDINA(dat = fit_dat,
                          Q = data.frame(sample_data$q_matrix),
                          model = "logitGDINA",
                          control = list(conv.type = "neg2LL"))
fit_m2(gdina_mod, ci = 0.9)

Run the code above in your browser using DataLab