Giter VIP home page Giter VIP logo

saudiwin / idealstan Goto Github PK

View Code? Open in Web Editor NEW
50.0 9.0 12.0 60.05 MB

idealstan offers item-response theory (IRT) ideal-point estimation for binary, ordinal, counts and continuous responses with time-varying and missing-data inference. Latent space model also included. Full and approximate Bayesian sampling with 'Stan' (www.mc-stan.org).

Home Page: https://cran.r-project.org/web/packages/idealstan/index.html

License: GNU General Public License v2.0

R 37.38% Stan 57.07% HTML 5.02% C++ 0.53%
rstats bayesian stan irt

idealstan's Introduction

Introduction to R Package Idealstan

Robert Kubinec December 27, 2021

Note: This is a beta release of idealstan v1.0. While most features have been implemented and are stable, some have not (ideal point marginal effects), and there may be bugs that have not been sorted out. To report bugs with the package, please file an issue on the Github page.

At present, idealstan is only available on Github as one of its main dependencies, cmdstanr is also not on CRAN. To use my package, cmdstanr must be first be set up with a local installation of cmdstan, which is used for estimation. To see how to install cmdstanr, see this guide. Note that the cmdstanr default installation location should be used when installing cmdstan.

To install this package, type the command remotes::install_github('saudiwin/idealstan',build_vignette=TRUE) at the R console prompt (you first must have the remotes package installed from CRAN for this to work). The best way to learn how the package works is to look at the package vignettes, which can be accessed by running the R commands:

# General introduction to the package
vignette("Package_Introduction",package="idealstan")

# Focus on dynamic models
vignette("Time_Series",package="idealstan")

If you use this package, please cite the following:

Kubinec, Robert. "Generalized Ideal Point Models for Time-Varying and Missing-Data Inference". SocArchiv (2019). doi:10.31219/osf.io/8j2bt.

The paper is available from this link.

About the Package

This package implements IRT (item response theory) ideal point models, which are models designed for situations in which actors make strategic choices that correlate with a unidimensional scale, such as the left-right axis in American politics. Compared to traditional IRT, ideal point models use a similar parameterization (the 2-Pl variant) but without the strong assumption that all items load in the same direction (i.e., higher ability). For more information, I refer you to my paper about IRT and ideal point models, documenting many of the features in the package.

The goal of idealstan is to offer both standard IRT/ideal point models and additional models for missing data, time-varying ideal points and diverse responses, such as binary, ordinal, count, continuous and positive-continuous outcomes. In addition, idealstan uses the Stan estimation engine to offer full and variational Bayesian inference for all models so that every model is estimated with uncertainty. Models can also have mixed outcomes, such as discrete and continuous responses.

The approach to handling missing data in this package is to model directly strategic censoring in observations. While this kind of missing data pattern can be found in many situations in which data is not missing at random, this particular version was developed to account for legislatures in which legislators (persons) are strategically absent for votes on bills (items). This approach to missing data can be usefully applied to many contexts in which a missing outcome is a function of the person's ideal point (i.e., people will tend to be present in the data when the item is far away or very close to their ideal point).

The package also includes ordinal ideal point models to handle situations in which a ranked outcome is polarizing, such as a legislator who can vote yes, no or to abstain. Because idealstan uses Bayesian inference, it can model any kind of ordinal data even if there aren't an even distribution of ordinal categories for each item.

The package also has extensive plotting functions via ggplot2 for model parameters, particularly the legislator (person) ideal points (ability parameters).

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.