Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

R package for the Bayesian estimation of diagnostic classification models using Stan

License

NotificationsYou must be signed in to change notification settings

wjakethompson/measr

Repository files navigation

Project Status: Active – The project has reached a stable, usable state and is being actively developed.lifecycleR package versionPackage downloadsDOI
R-CMD-checkcodecovNetlify Status
Signed byLicense

Diagnostic classification models (DCMs) are a class of psychometricmodels that estimate respondent abilities as a profile of proficiency ona pre-defined set of skills, or attributes. Despite the utility of DCMsfor providing fine-grained and actionable feedback with shorterassessments, they have are not widely used in applied settings, in partdue to a lack of user-friendly software. UsingR andStan, measr(said: “measure”) simplifies the process of estimating and evaluatingDCMs. Users can specify different DCM subtypes, define priordistributions, and estimate the model using therstan orcmdstanr interface to Stan. You canthen easily examine model parameters, calculate model fit metrics,compare competing models, and evaluate the reliability of theattributes.

Installation

You can install the released version of measr fromCRAN with:

install.packages("measr")

To install the development version of measr fromGitHub use:

# install.packages("remotes")remotes::install_github("wjakethompson/measr")

Because measr is based on Stan, a C++ compiler is required. For Windows,theRtools programcomes with a C++ compiler. On Mac, it’s recommended that you installXcode. For additional instructions and help setting up the compilers,see theRStan installation helppage.

Usage

We can estimate a DCM usingmeasr_dcm(). This function only requires adata set of item responses and a Q-matrix defining which attributes aremeasured by each item. We also identify any respondent or itemidentifier columns. Other arguments can be specified to customize thetype of model to estimates (see?measr_dcm()).

To demonstrate measr’s functionality, example data sets are included.Here we use the Examination of Certificate of Proficiency in English(ECPE;Templin & Hoffman, 2013)data (see?ecpe for details). Note that by default, measr uses a fullMarkov chain Monte Carlo (MCMC) estimation with Stan, which can be timeand computationally intensive. For a quicker estimation, we can useStan’s optimizer instead of MCMC by addingmethod = "optim" to thefunction call. However, please not that some functionality will be lostwhen using the optimizer (e.g., the calculation of relative fit criteriarequires the use of MCMC).

library(measr)model<- measr_dcm(data=ecpe_data,resp_id="resp_id",qmatrix=ecpe_qmatrix,item_id="item_id")

Once a model has been estimated, we can then add and evaluate model fit.This can done through absolute model fit, relative model fit(information criteria), or reliability indices. Model parameters,respondent classifications, and results of the model fit analyses canthen be extracted usingmeasr_extract().

model<- add_fit(model,method="m2")model<- add_criterion(model,criterion="loo")model<- add_reliability(model)measr_extract(model,"m2")#> # A tibble: 1 × 3#>      m2    df     pval#>   <dbl> <int>    <dbl>#> 1  506.   325 4.37e-10

Contributions are welcome. To ensure a smooth process, please review theContributing Guide. Pleasenote that the measr project is released with aContributor Code ofConduct. By contributing tothis project, you agree to abide by its terms.


[8]ページ先頭

©2009-2025 Movatter.jp