{"id":16273911,"url":"https://github.com/wjakethompson/measr","last_synced_at":"2025-07-03T15:06:33.466Z","repository":{"id":117956541,"uuid":"397418945","full_name":"wjakethompson/measr","owner":"wjakethompson","description":"R package for the Bayesian estimation of diagnostic classification models using Stan","archived":false,"fork":false,"pushed_at":"2025-01-23T18:10:36.000Z","size":160688,"stargazers_count":10,"open_issues_count":13,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T09:44:18.121Z","etag":null,"topics":["bayesian","cdm","cmdstanr","cognitive-diagnosis","cognitive-diagnostic-models","dcm","diagnostic-classification-models","psychometrics","r","r-package","rstan","rstats","stan"],"latest_commit_sha":null,"homepage":"https://measr.info","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wjakethompson.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-17T23:46:37.000Z","updated_at":"2025-01-23T17:46:10.000Z","dependencies_parsed_at":"2025-01-23T18:38:35.771Z","dependency_job_id":null,"html_url":"https://github.com/wjakethompson/measr","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakethompson%2Fmeasr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakethompson%2Fmeasr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakethompson%2Fmeasr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wjakethompson%2Fmeasr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wjakethompson","download_url":"https://codeload.github.com/wjakethompson/measr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243817081,"owners_count":20352496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian","cdm","cmdstanr","cognitive-diagnosis","cognitive-diagnostic-models","dcm","diagnostic-classification-models","psychometrics","r","r-package","rstan","rstats","stan"],"created_at":"2024-10-10T18:26:13.076Z","updated_at":"2025-07-03T15:06:33.448Z","avatar_url":"https://github.com/wjakethompson.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# measr \u003cimg src=\"man/figures/logo.png\" align =\"right\" width=\"120\"/\u003e\n\n\u003c!-- badges: start --\u003e\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n[![R package version](https://www.r-pkg.org/badges/version/measr)](https://cran.r-project.org/package=measr)\n[![Package downloads](https://cranlogs.r-pkg.org/badges/grand-total/measr)](https://cran.r-project.org/package=measr)\n[![DOI](https://joss.theoj.org/papers/10.21105/joss.05742/status.svg)](https://doi.org/10.21105/joss.05742)\u003c/br\u003e\n[![R-CMD-check](https://github.com/wjakethompson/measr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/wjakethompson/measr/actions/workflows/R-CMD-check.yaml)\n[![codecov](https://codecov.io/gh/wjakethompson/measr/branch/main/graph/badge.svg?token=JtF3xtGt6g)](https://app.codecov.io/gh/wjakethompson/measr)\n[![Netlify Status](https://api.netlify.com/api/v1/badges/b82caf01-0611-4f8b-bbca-5b89b5a80791/deploy-status)](https://app.netlify.com/sites/measr/deploys)\u003c/br\u003e\n[![Signed by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/wjakethompson)\n![License](https://img.shields.io/badge/License-GPL_v3-blue.svg)\n\u003c!-- badges: end --\u003e\n\nDiagnostic classification models (DCMs) are a class of psychometric models that estimate respondent abilities as a profile of proficiency on a pre-defined set of skills, or attributes.\nDespite the utility of DCMs for providing fine-grained and actionable feedback with shorter assessments, they have are not widely used in applied settings, in part due to a lack of user-friendly software.\nUsing [R](https://www.r-project.org/) and [Stan](https://mc-stan.org/), measr (said: \"measure\") simplifies the process of estimating and evaluating DCMs.\nUsers can specify different DCM subtypes, define prior distributions, and estimate the model using the [rstan](https://mc-stan.org/rstan/) or [cmdstanr](https://mc-stan.org/cmdstanr/) interface to Stan.\nYou can then easily examine model parameters, calculate model fit metrics, compare competing models, and evaluate the reliability of the attributes.\n\n## Installation\n\nYou can install the released version of measr from [CRAN](https://cran.r-project.org/) with:\n\n```r\ninstall.packages(\"measr\")\n```\n\nTo install the development version of measr from [GitHub](https://github.com/wjakethompson/measr) use:\n\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"wjakethompson/measr\")\n```\n\nBecause measr is based on Stan, a C++ compiler is required.\nFor Windows, the [Rtools program](https://cran.r-project.org/bin/windows/Rtools/) comes with a C++ compiler.\nOn Mac, it's recommended that you install Xcode.\nFor additional instructions and help setting up the compilers, see the [RStan installation help page](https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started).\n\n## Usage\n\nWe can define a DCM using `dcm_specify()`.\nThis function requires a Q-matrix defining which attributes are measured by each item.\nWe also identify any item identifier columns.\nOther arguments can be specified to customize the type of model to estimate (e.g., type of measurement or structural model; see `?dcmstan::dcm_specify()`).\nWe can then estimate our specified DCM using `dcm_estimate()`.\nWe supply our specification and our data set, along with any respondent identifiers.\nAs with `dcm_specify()`, other arguments can be specified to customize the model estimation process (e.g., estimation backend and method; see `?dcm_estimate()`).\n\nTo demonstrate measr's functionality, example data sets are available in the [dcmdata](https://dcmdata.r-dcm.org) package.\nHere we use the Examination of Certificate of Proficiency in English (ECPE; [Templin \u0026 Hoffman, 2013](https://doi.org/10.1111/emip.12010)) data (see `?dcmdata::ecpe` for details).\nNote that by default, measr uses a full Markov chain Monte Carlo (MCMC) estimation with Stan, which can be time and computationally intensive.\nFor a quicker estimation, we could use Stan's optimizer instead of MCMC by adding `method = \"optim\"` to the function call.\nHowever, please note that some functionality will be lost when using the optimizer (e.g., the calculation of some model fit criteria requires the use of MCMC).\n\n```{r est-model, eval = FALSE}\nlibrary(measr)\n\nmodel_spec \u003c- dcm_specify(dcmdata::ecpe_qmatrix, identifier = \"item_id\")\n\nmodel \u003c- dcm_estimate(dcm_spec = model_spec,\n                      data = dcmdata::ecpe_data, identifier = \"resp_id\",\n                      iter = 1000, warmup = 200, chains = 2, cores = 2)\n```\n\nOnce a model has been estimated, we can then add and evaluate model fit.\nThis can done through absolute model fit, relative model fit (information criteria), or reliability indices.\nModel parameters, respondent classifications, and results of the model fit analyses can then be extracted using `measr_extract()`.\n\n```{r evl-model, eval = FALSE}\nmodel \u003c- add_fit(model, method = \"m2\")\nmodel \u003c- add_criterion(model, criterion = \"loo\")\nmodel \u003c- add_reliability(model)\n\nmeasr_extract(model, \"m2\")\n#\u003e # A tibble: 1 × 3\n#\u003e      m2    df     pval\n#\u003e   \u003cdbl\u003e \u003cint\u003e    \u003cdbl\u003e\n#\u003e 1  514.   325 1.17e-10\n```\n\n\n---\n\nContributions are welcome.\nTo ensure a smooth process, please review the [Contributing Guide](https://measr.info/dev/CONTRIBUTING.html).\nPlease note that the measr project is released with a [Contributor Code of Conduct](https://measr.info/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwjakethompson%2Fmeasr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwjakethompson%2Fmeasr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwjakethompson%2Fmeasr/lists"}