fit_m2: Model Fit M2 Calculations

View source: R/m2-methods.R

fit_m2R Documentation

Model Fit M2 Calculations

Description

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

Usage

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

Arguments

model

An estimated diagnostic classification model.

ci

The confidence interval for the RMSEA.

...

Unused, for extensibility.

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

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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3102/1076998615621293")}

Examples

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)

dcm2 documentation built on April 1, 2023, 12:14 a.m.