Science Score: 36.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
-
○Academic publication links
-
✓Committers with academic emails
1 of 3 committers (33.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (17.2%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
forced choice in Item Response Theory R package
Statistics
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 3
- Releases: 1
Created almost 5 years ago
· Last pushed 11 months ago
Metadata Files
Readme
Changelog
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
warning = FALSE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "70%"
)
```
# fcirt
[](https://cran.r-project.org/package=fcirt)
[](https://cranlogs.r-pkg.org/badges/grand-total/fcirt "Total downloads")
The goal of fcirt is to estimate forced choice models using Bayesian method. Specifically, the Multi-Unidimensional Pairwise Preference (MUPP) model is estimated using the R package **rstan** that utilizes the Hamiltonian Monte Carlo sampling algorithm. Below are some important features of the fcirt package:
1. Item and test information calculated using either quadrature points or estimated person parameters can be obtained using the function information( ).
2. Missing data are automatically dealt with in a way similar to how full information maximum likelihood handles missing data.
3. Dimensions are allowed to correlate and the correlations are estimated.
4. Statements are allowed to appear multiple times in different items by specifying the required pairmap argument in the function fcirt().
5. Four functions (i.e., fcirt( ), extract( ), information( ), and bayesplot( )) are provided for model estimation, results extraction, item and test information computation, and Bayesian diagnostic plottings, respectively.
## Installation
You can install fcirt from CRAN:
``` r
install.packages("fcirt")
```
You can install the development version of fcirt from GitHub:
``` r
devtools::install_github("Naidantu/fcirt")
```
## Example
This is a basic example which shows you how to prepare data, fit the model, extract and plot results:
```{r example}
library(fcirt)
## basic example code
## Step 1: Input data
# 1.1 Response data in wide format. If the first statement is preferred, the data should be coded as 1, otherwise it should be coded as 2.
fcirt.Data <- c(1,2,2,1,1,1,1,1,NA,1,2,1,1,2,1,1,2,2,NA,2,2,2,1,1,1,2,1,1,1,1,2,1,1,1,2,1,1,2,1,1)
fcirt.Data <- matrix(fcirt.Data,nrow = 10)
fcirt.Data
# 1.2 A two-column data matrix: the first column is the statement number for statement s; the second column is the statement number for statement t.
pairmap <- c(1,3,5,7,2,4,6,8)
pairmap <- matrix(pairmap,ncol = 2)
pairmap
# 1.3 A column vector mapping each statement to each trait.
ind <- c(1,2,1,2,1,2,2,1)
# 1.4 A three-column matrix containing initial values for the three statement parameters (alpha, delta, tau) respectively. If using the direct MUPP estimation approach, 1 and -1 for alphas and taus are recommended and -1 or 1 for deltas are recommended depending on the signs of the statements. If using the two-step estimation approach, pre-estimated statement parameters are used as the initial values. The R package **bmggum** (Tu et al., 2021) can be used to estimate statement parameters for the two-step approach.
ParInits <- c(1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1)
ParInits <- matrix(ParInits, ncol = 3)
ParInits
## Step 2: Fit the MUPP model
mod <- fcirt(fcirt.Data=fcirt.Data, pairmap=pairmap, ind=ind, ParInits=ParInits, iter=1000)
## Step 3: Extract the estimated results
# 3.1 Extract the theta estimates
theta <- extract(x=mod, pars='theta')
# Turn the theta estimates into p*trait matrix where p equals sample size and trait equals the number of latent traits
theta <- theta[,1]
# nrow=trait
theta <- matrix(theta, nrow=2)
theta <- t(theta)
# theta estimates in p*trait matrix format
theta
# 3.2 Extract the tau estimates
tau <- extract(x=mod, pars='tau')
tau <- tau[,1]
tau
#3.3 Extract the estimates of the correlations among dimensions
cor <- extract(x=mod, pars='cor')
## Step 4: Plottings
# 4.1 Obtain the density plots for alpha
bayesplot(x=mod, pars='alpha', plot='density', inc_warmup=FALSE)
# 4.2 Obtain the trace plots for alpha
bayesplot(x=mod, pars='alpha', plot='trace', inc_warmup=FALSE)
## Step 5: Item information
# 5.1 Obtain item information for item 1-3
OII <- information(x=mod, approach="direct", information="item", items=1:3)
OII
# 5.2 Obtain test information
OTI <- information(x=mod, approach="direct", information="test")
OTI
```
Owner
- Name: Naidan Tu
- Login: Naidantu
- Kind: user
- Twitter: NaidanTu
- Repositories: 3
- Profile: https://github.com/Naidantu
PhD student in Industrial/Organizational Psychology at USF
GitHub Events
Total
- Issue comment event: 1
- Push event: 5
Last Year
- Issue comment event: 1
- Push event: 5
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Naidan Tu | n****u@u****u | 25 |
| Naidan Tu | n****u@N****l | 3 |
| Naidan Tu | 7****u | 1 |
Committer Domains (Top 20 + Academic)
usf.edu: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 2
- Total pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 2
- Total pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 2.0
- Merged pull requests: 0
- 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
- huapsy (1)
- JieXinLim (1)
Pull Request Authors
- andrjohns (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 228 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
cran.r-project.org: fcirt
Forced Choice in Item Response Theory
- Homepage: https://github.com/Naidantu/fcirt
- Documentation: http://cran.r-project.org/web/packages/fcirt/fcirt.pdf
- License: GPL (≥ 3)
-
Latest release: 0.1.0
published over 4 years ago
Rankings
Forks count: 28.8%
Dependent packages count: 29.8%
Stargazers count: 31.7%
Dependent repos count: 35.5%
Average: 41.0%
Downloads: 79.3%
Maintainers (1)
Last synced:
11 months ago
Dependencies
DESCRIPTION
cran
- R >= 3.4.0 depends
- Rcpp >= 0.12.0 imports
- RcppParallel >= 5.0.1 imports
- edstan * imports
- methods * imports
- numDeriv * imports
- rstan >= 2.18.1 imports
- rstantools >= 2.1.1 imports
- knitr * suggests
- rmarkdown * suggests