Learn R Programming

Political Science Computational Laboratory

Description

pscl is an R package providing classes, methods and test data for

  • Bayesian analysis of roll call data and other binary, item-response type data (e.g., from surveys or educational testing).

  • elementary Bayesian statistics

  • maximum likelihood estimation of zero-inflated and hurdle models for count data

  • utility functions

Historical note

The Political Science Computational Laboratory was the name of Simon Jackman's research group at Stanford University's Department of Political Science (2002-2014), where this package was first developed.

The hurdle and count data models were extensively re-written and updated by Achim Zeileis and Christian Kleiber.

Installation

Most users should use latest stable release of the package, which can be installed from CRAN by running

install.packages("pscl")

The development version can be installed directly from GitHub by running

install.packages("devtools") ## if not already installed
library(devtools)
install_github("atahk/pscl")

Copy Link

Version

Install

install.packages('pscl')

Monthly Downloads

43,631

Version

1.5.9

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

January 31st, 2024

Functions in pscl (1.5.9)

hurdle

Hurdle Models for Count Data Regression
hurdle.control

Control Parameters for Hurdle Count Data Regression
constrain.legis

constrain legislators' ideal points in analysis of roll call data
convertCodes

convert entries in a rollcall matrix to binary form
hurdletest

Testing for the Presence of a Zero Hurdle
betaHPD

compute and optionally plot beta HDRs
nj07

rollcall object, National Journal key votes of 2007
ideal

analysis of educational testing data and roll call data with IRT models, via Markov chain Monte Carlo methods
extractRollCallObject

return the roll call object used in fitting an ideal model
dropUnanimous

drop unanimous votes from rollcall objects and matrices
iraqVote

U.S. Senate vote on the use of force against Iraq, 2002.
dropRollCall

drop user-specified elements from a rollcall object
pR2

compute various pseudo-R2 measures
constrain.items

constrain item parameters in analysis of roll call data
plot.predict.ideal

plot methods for predictions from ideal objects
plot.ideal

plots an ideal object
hitmiss

Table of Actual Outcomes against Predicted Outcomes for discrete data models
prussian

Prussian army horse kick data
partycodes

political parties appearing in the U.S. Congress
readKH

read roll call data in Poole-Rosenthal KH format
predict.ideal

predicted probabilities from an ideal object
predict.zeroinfl

Methods for zeroinfl Objects
computeMargins

add information about voting outcomes to a rollcall object
predprob

compute predicted probabilities from fitted models
simpi

Monte Carlo estimate of pi (3.14159265...)
plot.seatsVotes

plot seats-votes curves
idealToMCMC

convert an object of class ideal to a coda MCMC object
igamma

inverse-Gamma distribution
summary.ideal

summary of an ideal object
presidentialElections

elections for U.S. President, 1932-2016, by state
postProcess

remap MCMC output via affine transformations
sc9497

votes from the United States Supreme Court, from 1994-1997
summary.rollcall

summarize a rollcall object
zeroinfl

Zero-inflated Count Data Regression
rollcall

create an object of class rollcall
state.info

information about the American states needed for U.S. Congress
predprob.ideal

predicted probabilities from fitting ideal to rollcall data
predprob.glm

Predicted Probabilities for GLM Fits
tracex

trace plot of MCMC iterates, posterior density of legislators' ideal points
odTest

likelihood ratio test for over-dispersion in count data
s109

rollcall object, 109th U.S. Senate (2005-06).
seatsVotes

A class for creating seats-votes curves
predict.hurdle

Methods for hurdle Objects
ntable

nicely formatted tables
vectorRepresentation

convert roll call matrix to series of vectors
vuong

Vuong's non-nested hypothesis test
politicalInformation

Interviewer ratings of respondent levels of political information
unionDensity

cross national rates of trade union density
vote92

Reports of voting in the 1992 U.S. Presidential election.
zeroinfl.control

Control Parameters for Zero-inflated Count Data Regression
UKHouseOfCommons

1992 United Kingdom electoral returns
EfronMorris

Batting Averages for 18 major league baseball players, 1970
RockTheVote

Voter turnout experiment, using Rock The Vote ads
AustralianElections

elections to Australian House of Representatives, 1949-2016
AustralianElectionPolling

Political opinion polls in Australia, 2004-07
ca2006

California Congressional Districts in 2006
bioChemists

article production by graduate students in biochemistry Ph.D. programs
admit

Applications to a Political Science PhD Program
absentee

Absentee and Machine Ballots in Pennsylvania State Senate Races