thurstonianIRT
thurstonianIRT: Thurstonian IRT Models in R - Published in JOSS (2019)
Science Score: 95.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: springer.com, joss.theoj.org -
✓Committers with academic emails
3 of 9 committers (33.3%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords from Contributors
bayesian-statistics
Last synced: 6 months ago
·
JSON representation
Repository
Fit Thurstonian IRT models in R using Stan, lavaan, or Mplus
Basic Info
Statistics
- Stars: 34
- Watchers: 7
- Forks: 12
- Open Issues: 12
- Releases: 1
Created almost 8 years ago
· Last pushed almost 2 years ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output:
md_document:
variant: markdown_github
editor_options:
chunk_output_type: console
---
```{r, include=FALSE}
stopifnot(require(knitr))
options(width = 90)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
dev = "png",
dpi = 150,
fig.asp = 0.8,
fig.width = 5,
out.width = "60%",
fig.align = "center"
)
library(thurstonianIRT)
set.seed(1234)
```
# thurstonianIRT
[](https://doi.org/10.21105/joss.01662)
[](https://app.travis-ci.com/paul-buerkner/thurstonianIRT)
[](https://cran.r-project.org/package=thurstonianIRT)
## Overview
The **thurstonianIRT** package allows to fit various models from [Item Response
Theory (IRT)](https://en.wikipedia.org/wiki/Item_response_theory) for
forced-choice questionnaires, most notably the Thurstonian IRT model originally
proposed by (Brown & Maydeu-Olivares, 2011). IRT in general comes with several
advantages over classical test theory, for instance, the ability to model
varying item difficulties as well as item factor loadings on the participants'
traits they are supposed to measure. Moreover, if multiple traits are modeled
at the same time, their correlation can be incorporated into an IRT model to
improve the overall estimation accuracy. The key characteristic of
forced-choice questionnaires is that participants cannot endorse all items at
the same time and instead have to make a comparative judgment between two or
more items. Such a format comes with the hope of providing more valid inference
in situation where participants have motivation to not answer honestly (e.g.,
in personnel selection), but instead respond in a way that appears favorable in
the given situation. Whether forced-choice questionnaires and the corresponding
IRT models live up to this hope remains a topic of debate (e.g., see Bürkner,
Schulte, & Holling, 2019) but it is in any case necessary to provide software
for fitting these statistical models both for practical and research purposes.
In the original formulation, the Thurstonian IRT model works on dichotomous
pairwise comparisons and models the probability of endorsing one versus the
other item. This probability depends on parameters related to the items under
comparison as well as on parameters related to the participants' latent traits
which are assumed to be measured by the items. For more details see Brown and
Maydeu-Olivares (2011), Brown and Maydeu-Olivares (2012), and Bürkner et al.
(2019).
## How to use thurstonianIRT
```{r}
library(thurstonianIRT)
```
As a simple example consider a data set of 4 blocks each
containing 3 items (i.e., triplets) answered by 200 participants.
```{r}
data("triplets")
head(triplets)
```
In the data set, a 1 indicates that the first item has been selected over the
second item while a 0 indicates that the second items has been selected
over the first item. In order to fit a Thurstonian IRT model on this data,
we have to tell **thurstonianIRT** about the block structure of the items,
the traits on which the items load, and the sign of these loadings, that is,
whether items have been inverted. For the present data, we specify
this as follows:
```{r}
blocks <-
set_block(c("i1", "i2", "i3"), traits = c("t1", "t2", "t3"),
signs = c(1, 1, 1)) +
set_block(c("i4", "i5", "i6"), traits = c("t1", "t2", "t3"),
signs = c(-1, 1, 1)) +
set_block(c("i7", "i8", "i9"), traits = c("t1", "t2", "t3"),
signs = c(1, 1, -1)) +
set_block(c("i10", "i11", "i12"), traits = c("t1", "t2", "t3"),
signs = c(1, -1, 1))
```
Next, we transform the data into a format that **thurstonianIRT** understands.
```{r}
triplets_long <- make_TIRT_data(
data = triplets, blocks = blocks, direction = "larger",
format = "pairwise", family = "bernoulli", range = c(0, 1)
)
head(triplets_long)
```
Finally, we can fit the model using several model fitting engines. Currently
supported are [Stan](https://mc-stan.org/), [lavaan](https://lavaan.ugent.be/),
and [Mplus](http://www.statmodel.com/). Here, we choose Stan to fit the
Thurstonian IRT model in a Bayesian framework.
```{r, results="hide"}
fit <- fit_TIRT_stan(triplets_long, chains = 1)
```
As basic summary and convergence checks can be obtained via
```{r, eval=FALSE}
print(fit)
```
Finally, we obtain predictions of participants' trait scores in a tidy
data format via
```{r}
pr <- predict(fit)
head(pr)
```
The thurstonianIRT package not only comes with model fitting functions but
also with the possibility to simulate data from Thurstonian IRT models.
Below we simulate data with a very similar structure to the `triplets`
data set we have used above.
```{r}
sim_data <- sim_TIRT_data(
npersons = 200,
ntraits = 3,
nblocks_per_trait = 4,
gamma = 0,
lambda = runif(12, 0.5, 1),
Phi = diag(3)
)
head(sim_data)
```
The structure of the data is the same as what we obtain via
the `make_TIRT_data` function and can readily be passed to the model
fitting functions.
## FAQ
### How to install thurstonianIRT
To install the latest release version from CRAN use
```{r, eval = FALSE}
install.packages("thurstonianIRT")
```
The current developmental version can be downloaded from github via
```{r, eval = FALSE}
if (!requireNamespace("remotes")) {
install.packages("remotes")
}
remotes::install_github("paul-buerkner/thurstonianIRT")
```
### I am new to thurstonianIRT. Where can I start?
After reading the README, you probably have a good overview already over the
packages purporse and main functionality. You can dive deeper by reading the
package's documentation perhaps starting with `help("thurstonianIRT")`. If you
want to perform a simulation study with the package, I recommend you take a look
at `vignette("TIRT_sim_tests")`.
### Where do I ask questions, propose a new feature, or report a bug?
To ask a question, propose a new feature or report a bug, please open an
issue on [GitHub](https://github.com/paul-buerkner/thurstonianIRT).
### How can I contribute to thurstonianIRT?
If you want to contribute to thurstonianIRT, you can best do this via the
package's [GitHub](https://github.com/paul-buerkner/thurstonianIRT) page. There,
you can fork the repository, open new issues (e.g., to report a bug), or make
pull requests to improve the software and documentation. I am grateful for all
kinds of contributions, even if they are just as small as fixing a typo in the
documentation.
## References
Brown, A., & Maydeu-Olivares, A. (2011). Item response modeling of forced-choice questionnaires. *Educational and Psychological Measurement*, 71(3), 460-502.
https://journals.sagepub.com/doi/10.1177/0013164410375112
Brown, A., & Maydeu-Olivares, A. (2012). Fitting a Thurstonian IRT model to forced-choice data using Mplus. *Behavior Research Methods*, 44(4), 1135-1147.
https://link.springer.com/article/10.3758/s13428-012-0217-x
Bürkner P. C., Schulte N., & Holling H. (2019). On the Statistical and Practical Limitations of Thurstonian IRT Models. *Educational and Psychological Measurement.* https://journals.sagepub.com/doi/10.1177/0013164419832063
Owner
- Name: Paul-Christian Bürkner
- Login: paul-buerkner
- Kind: user
- Location: Department of Statistics, TU Dortmund University
- Website: https://paul-buerkner.github.io/
- Repositories: 22
- Profile: https://github.com/paul-buerkner
JOSS Publication
thurstonianIRT: Thurstonian IRT Models in R
Published
October 23, 2019
Volume 4, Issue 42, Page 1662
Tags
item response theory forced-choice data lavaanGitHub Events
Total
- Issues event: 1
- Watch event: 4
Last Year
- Issues event: 1
- Watch event: 4
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Paul Buerkner | p****r@g****m | 126 |
| Angus Hughes | a****s@r****u | 5 |
| Jonah Gabry | j****y@g****m | 2 |
| mpadge | m****m@e****m | 1 |
| Russell S. Pierce | R****e@g****m | 1 |
| Daniel S. Katz | d****z@i****g | 1 |
| Andrew Johnson | a****n@a****m | 1 |
| ivan | i****n@M****l | 1 |
| Andrew Johnson | a****n@p****u | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 33
- Total pull requests: 11
- Average time to close issues: 4 months
- Average time to close pull requests: 3 months
- Total issue authors: 21
- Total pull request authors: 9
- Average comments per issue: 2.36
- Average comments per pull request: 1.64
- Merged pull requests: 10
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- russellpierce (6)
- Pozdniakov (3)
- b1azk0 (2)
- Arizazcq97 (2)
- leonardomose (2)
- bozhang3 (2)
- yrosseel (2)
- SamSWebb (2)
- mpadge (1)
- alannamay (1)
- maisym00 (1)
- topherwhatever (1)
- szzhou4 (1)
- IanEisenberg (1)
- PeterLtr (1)
Pull Request Authors
- awhug (2)
- andrjohns (2)
- Pozdniakov (1)
- paul-buerkner (1)
- IanEisenberg (1)
- russellpierce (1)
- jgabry (1)
- danielskatz (1)
- mpadge (1)
Top Labels
Issue Labels
bug (3)
enhancement (2)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 388 last-month
- Total dependent packages: 1
- Total dependent repositories: 1
- Total versions: 8
- Total maintainers: 1
cran.r-project.org: thurstonianIRT
Thurstonian IRT Models
- Homepage: https://github.com/paul-buerkner/thurstonianIRT
- Documentation: http://cran.r-project.org/web/packages/thurstonianIRT/thurstonianIRT.pdf
- License: GPL (≥ 3)
-
Latest release: 0.12.5
published almost 2 years ago
Rankings
Forks count: 5.8%
Stargazers count: 9.9%
Average: 19.4%
Dependent repos count: 23.9%
Dependent packages count: 28.7%
Downloads: 28.9%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.5.0 depends
- Rcpp >= 0.12.16 depends
- methods * depends
- MplusAutomation * imports
- RcppParallel >= 5.0.1 imports
- dplyr >= 0.6.0 imports
- knitr * imports
- lavaan >= 0.6 imports
- magrittr * imports
- mvtnorm * imports
- rlang * imports
- rstan >= 2.18.1 imports
- rstantools >= 2.1.1 imports
- stats * imports
- tibble >= 1.3.1 imports
- tidyr * imports
- utils * imports
- rmarkdown * suggests
- testthat >= 0.9.1 suggests
