Code Monkey home page Code Monkey logo

mpt2irt's Introduction

Travis build status

mpt2irt

mpt2irt is an R package that accompanies the paper A new model for acquiescence at the interface of psychometrics and cognitive psychology (Plieninger & Heck, 2018). Therein, we extend the response style model of Böckenholt (2012) to acquiescence. The model is essentially a hierarchical multinomial processing tree (MPT) model with an item response theory (IRT) structure of its parameters. To estimate the model parameters, we build on Bayesian hierarchical modeling and fit the model in either Stan or JAGS.

Installation

In order to use the package, you will need either JAGS or RStan.

Install JAGS

To install JAGS, visit https://sourceforge.net/projects/mcmc-jags/.

Install RStan

To install RStan, visit https://github.com/stan-dev and carefully follow the instructions. This may also involve the following steps:

Install mpt2irt

Actually, the Stan part of mpt2irt was split off for easier maintenance and is provided in the package mpt2irtStan. User have to install both packages even though they will interface only with mpt2irt.

The package mpt2irt can be installed directly from GitHub, and this should automatically also install mpt2irtStan:

# install.packages("remotes")
remotes::install_github("hplieninger/mpt2irt")

However, because compiling the code in mpt2irtStan takes a while and may need a special setup (see above), users are encouraged to first install mpt2irtStan via remotes::install_github("hplieninger/mpt2irtStan"). During installation, users may be asked to update or install the rstantools package (version >= 2.0.0) and should agree. If this was successful, the main package mpt2irt can be installed afterwards.

Usage

# This is a minimal working example, where data are generated and subsequently fit.
library("mpt2irt")
N <- 20
J <- 10
betas <- cbind(rnorm(J, .5), rnorm(J, .5), rnorm(J, 1.5), rnorm(J, 0))
dat   <- generate_irtree_ext(N = N, J = J, betas = betas, beta_ARS_extreme = .5)

# fit model
res1 <- fit_irtree(dat$X, revItem = dat$revItem, M = 200)
res2 <- summarize_irtree_fit(res1)
res3 <- tidyup_irtree_fit(res2)
res3$plot

Misc

The proposed Acquiescence Model is a mixture model. Existing approaches to ARS (e.g., Billiet & McClendon, 2000; Ferrando et al., 2016; Maydeu-Olivares & Coffman, 2006) view acquiescence as a shift process. A graphical comparison of the two approaches in terms of the predicted category probabilities may be found at https://hplieninger.shinyapps.io/shift-vs-mixture-ARS.

mpt2irt's People

Contributors

hplieninger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.