Commit df53a8ee authored by Andreas Tille's avatar Andreas Tille

Import Upstream version 1.5.1

parent 657a49ad
Package: pscl
Version: 1.4.9
Date: 2015-03-29
Title: Political Science Computational Laboratory, Stanford University
Version: 1.5.1
Date: 2017-07-19
Title: Political Science Computational Laboratory
Author: Simon Jackman, with contributions from
Alex Tahk, Achim Zeileis, Christina Maimone and Jim Fearon
Maintainer: Simon Jackman <jackman@stanford.edu>
Depends: MASS, lattice
Suggests: MCMCpack, car, lmtest, sandwich, zoo, coda, vcd, mvtnorm,
mgcv
Enhances: stats
Alex Tahk, Achim Zeileis, Christina Maimone, Jim Fearon and Zoe Meers
Maintainer: Simon Jackman <simon.jackman@sydney.edu.au>
Imports: MASS, datasets, grDevices, graphics, stats, utils
Suggests: lattice, MCMCpack, car, lmtest, sandwich, zoo, coda, vcd,
mvtnorm, mgcv
Description: Bayesian analysis of item-response theory (IRT) models,
roll call analysis; computing highest density regions; maximum
likelihood estimation of zero-inflated and hurdle models for count
......@@ -17,8 +16,8 @@ Description: Bayesian analysis of item-response theory (IRT) models,
Computational Laboratory; seats-votes curves.
LazyData: true
License: GPL-2
URL: http://pscl.stanford.edu/
URL: http://github.com/atahk/pscl
NeedsCompilation: yes
Packaged: 2015-03-29 07:15:16 UTC; jackman
Packaged: 2017-07-28 05:27:32 UTC; jackman
Repository: CRAN
Date/Publication: 2015-03-29 11:23:22
Date/Publication: 2017-08-30 12:47:39 UTC
This diff is collapsed.
......@@ -27,11 +27,21 @@ export("seatsVotes", "plot.seatsVotes")
export("hitmiss", "pR2")
importFrom("MASS", "glm.nb")
importFrom("MASS", "polr")
importFrom("lattice","xyplot")
importFrom("lattice","panel.lines")
importFrom("stats", "logLik")
importFrom("MASS", "glm.nb", "polr")
importFrom("grDevices", "dev.interactive", "gray", "rainbow")
importFrom("graphics", "abline", "axis", "layout", "legend", "lines",
"mtext", "pairs", "par", "plot", "points", "polygon", "rug",
"text", "title")
importFrom("stats", ".getXlevels", "AIC", "binomial", "coef", "cor",
"dbeta", "delete.response", "density", "dnbinom", "dpois",
"family", "glm", "glm.fit", "lm", "loess", "logLik",
"make.link", "model.frame", "model.matrix", "model.response",
"model.weights", "na.omit", "na.pass", "optim", "optimize",
"pbeta", "pchisq", "pgamma", "pnbinom", "pnorm", "poisson",
"ppois", "predict", "printCoefmat", "qbeta", "qchisq",
"qgamma", "quantile", "residuals", "rgamma", "rnorm", "sd",
"terms", "uniroot", "update")
importFrom("utils", "tail")
## methods for class zeroinfl
S3method("print", "zeroinfl")
......
This diff is collapsed.
.onAttach <- function(libname,pkgname){
## cat(paste(" pscl",
## paste(rep(".",floor(getOption("width")*.90 - 4)),collapse=""),
## "\n",
## sep="")
## )
ver <- read.dcf(file=system.file("DESCRIPTION", package=pkgname),
fields=c("Version", "Date"))
packageStartupMessage(paste(pkgname, ver[1], "\t", ver[2], "\n"))
#cat(" R classes and methods developed in the\n")
#cat(" Political Science Computational Laboratory\n")
#cat(" Department of Political Science, Stanford University\n")
#cat(" Simon Jackman <jackman@stanford.edu>\n")
#cat(" http://pscl.stanford.edu\n")
invisible(NULL)
}
.onUnload <- function(){
invisible(NULL)
}
......@@ -13,7 +13,8 @@ ideal <- function(object,
startvals="eigen",
store.item=FALSE,
file=NULL,
verbose=FALSE){
verbose=FALSE,
use.voter=NULL){
cat("ideal: analysis of roll call data via Markov chain Monte Carlo methods.\n\n")
......@@ -110,6 +111,13 @@ ideal <- function(object,
legis.names <- dimnames(y$votes)[[1]]
vote.names <- dimnames(y$votes)[[2]]
if (!is.null(use.voter)) {
if (!is.vector(use.voter))
stop("use.voter must be a vector of length n")
if (n != length(use.voter))
stop("use.voter must be a vector of length n")
}
## map roll call votes into binary format required by ideal
if(verbose){
printCodes(codes)
......@@ -400,7 +408,7 @@ ideal <- function(object,
xoutput=NULL,
boutput=NULL,as.integer(burnin),
as.integer(usefile), as.integer(store.item), as.character(file),
as.integer(verbose))
as.integer(verbose), as.integer(!is.null(use.voter)), as.integer(use.voter))
}
## not saving output to file, saving output to memory
else if (!store.item) {
......@@ -415,7 +423,7 @@ ideal <- function(object,
boutput=as.double(0),
as.integer(burnin),
as.integer(usefile), as.integer(store.item), as.character(file),
as.integer(verbose))
as.integer(verbose), as.integer(!is.null(use.voter)), as.integer(use.voter))
}
else {
output <- .C("IDEAL",
......@@ -428,7 +436,7 @@ ideal <- function(object,
xoutput=as.double(rep(0,n*d*numrec)),
boutput=as.double(rep(0,m*(d+1)*numrec)),as.integer(burnin),
as.integer(usefile), as.integer(store.item), as.character(file),
as.integer(verbose))
as.integer(verbose), as.integer(!is.null(use.voter)), as.integer(use.voter))
}
cat("\n")
......@@ -441,7 +449,6 @@ ideal <- function(object,
keep <- itervec > burnin
## ideal points
print(output$xoutput[1:(n*d)])
x <- array(output$xoutput,
c(n,d,numrec))
......@@ -459,7 +466,6 @@ ideal <- function(object,
###############################################################
## item parameters
if(store.item){
print(vote.names)
b <- array(output$boutput,c(m,d+1,numrec)) ## votes by parameters by iters
dimnames(b) <- list(vote.names,
c(paste("Discrimination D",1:d,sep=""),
......
......@@ -60,7 +60,7 @@ readKH <- function(file,
state <- as.numeric(substring(data,9,10)) ## icpsr code
KHstateName <- substring(data,13,20)
stateName <- statename(state) ## covert to name
stateAbb <- state.abb[match(stateName,state.name)] ## convert to abbrev
stateAbb <- datasets::state.abb[match(stateName,datasets::state.name)] ## convert to abbrev
stateAbb[grep(KHstateName,pattern="^USA")] <- "USA" ## for presidents
cd <- as.numeric(substring(data,11,12))
......
......@@ -12,12 +12,12 @@
##}
.onAttach <- function(...){
packageStartupMessage("Classes and Methods for R developed in the\n")
packageStartupMessage("Political Science Computational Laboratory\n")
packageStartupMessage("Department of Political Science\n")
packageStartupMessage("Stanford University\n")
packageStartupMessage("Simon Jackman\n")
packageStartupMessage("hurdle and zeroinfl functions by Achim Zeileis\n")
packageStartupMessage("Classes and Methods for R developed in the\n",
"Political Science Computational Laboratory\n",
"Department of Political Science\n",
"Stanford University\n",
"Simon Jackman\n",
"hurdle and zeroinfl functions by Achim Zeileis")
}
.onUnload <- function(libpath){
......
1. Put any C/C++/Fortran code in 'src'
2. If you have compiled code, add a .First.lib() function in 'R'
to load the shared library
3. Edit the help file skeletons in 'man'
4. Run R CMD build to create the index files
5. Run R CMD check to check the package
6. Run R CMD build to make the package file
when building on the Mac, can remove resource forks as follows:
find . -type f -exec cp /dev/null {}/..namedfork/rsrc \;
Read "Writing R Extensions" for more information.
No preview for this file type
......@@ -6,22 +6,22 @@ year <- sub("-.*", "", meta$Date)
note <- sprintf("R package version %s", meta$Version)
citEntry(entry="Manual",
title = "{pscl}: Classes and Methods for {R} Developed in the Political Science Computational Laboratory, Stanford University",
author = person("Simon", "Jackman", email = "jackman@stanford.edu"),
organization = "Department of Political Science, Stanford University",
address = "Stanford, California",
title = "{pscl}: Classes and Methods for {R} Developed in the Political Science Computational Laboratory",
author = person("Simon", "Jackman", email = "simon.jackman@sydney.edu.au"),
organization = "United States Studies Centre, University of Sydney",
address = "Sydney, New South Wales, Australia",
year = year,
note = note,
url = "http://pscl.stanford.edu/",
url = "https://github.com/atahk/pscl/",
textVersion =
paste("Simon Jackman",
sprintf("(%s).", year),
"pscl: Classes and Methods for R Developed in the Political Science Computational Laboratory, Stanford University.",
"Department of Political Science, Stanford University.",
"Stanford, California.",
"pscl: Classes and Methods for R Developed in the Political Science Computational Laboratory.",
"United States Studies Centre, University of Sydney.",
"Sydney, New South Wales, Australia.",
paste(note, ".", sep = ""),
"URL http://pscl.stanford.edu/")
"URL https://github.com/atahk/pscl/")
)
citEntry(entry="Article",
......
......@@ -128,7 +128,7 @@ if(file.exists("countreg-models.rda")) {
} else {
fm_pois <- glm(ofp ~ ., data = dt, family = poisson)
fm_qpois <- glm(ofp ~ ., data = dt, family = quasipoisson)
fm_nbin <- glm.nb(ofp ~ ., data = dt)
fm_nbin <- MASS::glm.nb(ofp ~ ., data = dt)
fm_zinb0 <- zeroinfl(ofp ~ ., data = dt, dist = "negbin")
fm_zinb <- zeroinfl(ofp ~ . | hosp + numchron + privins + school + gender, data = dt, dist = "negbin")
fm_hurdle0<- hurdle(ofp ~ ., data = dt, dist = "negbin")
......@@ -171,7 +171,7 @@ coeftest(fm_pois, vcov = sandwich)
###################################################
### code chunk number 19: nbin (eval = FALSE)
###################################################
## fm_nbin <- glm.nb(ofp ~ ., data = dt)
## fm_nbin <- MASS::glm.nb(ofp ~ ., data = dt)
## summary(fm_nbin)
......
......@@ -732,7 +732,7 @@ if(file.exists("countreg-models.rda")) {
} else {
fm_pois <- glm(ofp ~ ., data = dt, family = poisson)
fm_qpois <- glm(ofp ~ ., data = dt, family = quasipoisson)
fm_nbin <- glm.nb(ofp ~ ., data = dt)
fm_nbin <- MASS::glm.nb(ofp ~ ., data = dt)
fm_zinb0 <- zeroinfl(ofp ~ ., data = dt, dist = "negbin")
fm_zinb <- zeroinfl(ofp ~ . | hosp + numchron + privins + school + gender, data = dt, dist = "negbin")
fm_hurdle0<- hurdle(ofp ~ ., data = dt, dist = "negbin")
......@@ -795,7 +795,7 @@ The output is suppressed here and is presented in tabular form in Table~\ref{tab
A more formal way to accommodate over-dispersion in a count data regression
model is to use a negative binomial model, as in
<<nbin, eval=FALSE>>=
fm_nbin <- glm.nb(ofp ~ ., data = dt)
fm_nbin <- MASS::glm.nb(ofp ~ ., data = dt)
summary(fm_nbin)
@
As shown in Table~\ref{tab:summary},
......
No preview for this file type
......@@ -42,12 +42,14 @@ The ALP changed leaders twice in the 2004-07 inter-election period spanned by th
}
\examples{
data(AustralianElectionPolling)
lattice::xyplot(ALP ~ startDate | org,
if(require(lattice)) {
lattice::xyplot(ALP ~ startDate | org,
data=AustralianElectionPolling,
layout=c(1,5),
type="b",
xlab="Start Date",
ylab="ALP")
}
## test for house effects
y <- AustralianElectionPolling$ALP/100
......
......@@ -2,11 +2,11 @@
\alias{AustralianElections}
\docType{data}
\title{elections to Australian House of
Representatives, 1949-2007}
Representatives, 1949-2016}
\description{
Aggregate data on the 24 elections to Australia's House of
Representatives, 1949 to 2007.
Representatives, 1949 to 2016.
}
\usage{data(AustralianElections)}
......@@ -54,6 +54,8 @@
}
}
\note{The Liberal National Party of Queensland formed in 2008 after a merger of the Liberal Party and the National Party. In all elections following 2008, they have been categorised under \code{LP}.}
\source{Australian Electoral Commission. \url{http://www.aec.gov.au}.
}
......
......@@ -89,7 +89,7 @@
Debugging messages are printed to the console if the \code{debug}
logical flag is set to \code{TRUE}.
}
\author{Simon Jackman \email{jackman@stanford.edu}. Thanks to John
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}. Thanks to John
Bullock who discovered a bug in an earlier version.}
\seealso{\code{\link{pbeta}}, \code{\link{qbeta}},
\code{\link{dbeta}}, \code{\link{uniroot}}}
......
......@@ -31,8 +31,8 @@
}
\source{2006 data from the California Secretary of State's web site,
\url{http://vote2006.sos.ca.gov/Returns/usrep/all.htm}.
%%Excel data at \url{http://www.sos.ca.gov/elections/sov/2006_general/congress.xls}.
\url{http://www.sos.ca.gov/elections/prior-elections/statewide-election-results/general-election-november-7-2006/statement-vote/}.
%%Excel data at \url{http://elections.cdn.sos.ca.gov/sov/2006-general/congress.xls}.
2004 and 2000 presidential vote in congressional districts from the 2006 \emph{Almanac of American Politics}.
Thanks to Arthur Aguirre for the updated links, above.
......
......@@ -38,7 +38,7 @@ computeMargins(object, dropList = NULL)
roll call}
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{dropRollCall}} on specifying a \code{dropList}.
The vote-specific marginals produced by theis function are used by as
......
......@@ -24,7 +24,7 @@ convertCodes(object, codes = object$codes)
}
\value{a \code{\link{matrix}} with dimensions equal to the dimensions of
the \code{votes} component of the \code{rollcall} object.}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\note{Any entries in the \code{votes} matrix that can
not be mapped into \code{c(0,1,NA)} using the information in
\code{codes} are mapped to \code{NA}, with an informative message
......
......@@ -61,7 +61,7 @@ dropRollCall(object, dropList,debug=FALSE)
An object of class \code{\link{rollcall}} with components modified/added by
the subsetting indicated in the \code{dropList}.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\note{
With the exception of \code{codes}, each component of
......
......@@ -35,7 +35,7 @@
A \code{\link{rollcall}} object or a \code{\link{matrix}} depending on
the class of \code{object}.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{dropRollCall}},
\code{\link{rollcall}}, \code{\link{summary.rollcall}}, \code{\link{ideal}}}
\examples{
......
......@@ -24,7 +24,7 @@ extractRollCallObject(object)
\value{
An object of class \code{\link{rollcall}}
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{rollcall}}; see \code{\link{dropRollCall}} for
details on the form of a \code{dropList}.}
\examples{
......
......@@ -45,7 +45,7 @@ hitmiss(obj, digits = max(3, getOption("digits") - 3), ...)
\item{pcp1}{Percent Correctly Predicted among y=1}
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\note{To-do: The \code{glm} method should also handle binomial data presented
as two-vector success/failures counts; and count data with
......
......@@ -17,7 +17,7 @@ ideal(object, codes = object$codes,
meanzero = normalize,
priors = NULL, startvals = "eigen",
store.item = FALSE, file = NULL,
verbose=FALSE)
verbose=FALSE, use.voter=NULL)
}
\arguments{
......@@ -102,6 +102,14 @@ ideal(object, codes = object$codes,
\item{verbose}{logical, default
is \code{FALSE}, which generates relatively little output to the R
console during execution.}
\item{use.voter}{A vector of logicals of length \code{n} controlling
which legislators' vote data informs item parameter
estimates. Legislators corresponding to \code{FALSE} entries will
not have their voting data included in updates of the item
parameters. The default value of \code{NULL} will run the standard
ideal-point model, which uses all legislators in updating item
parameters. See Jessee (2016).}
}
\details{The function fits a \code{d}+1 parameter item-response model to
......@@ -318,6 +326,10 @@ ideal(object, codes = object$codes,
Jackman, Simon. 2009. \emph{Bayesian Analysis for the Social
Sciences}. Wiley: Hoboken, New Jersey.
Jessee, Stephen. 2016. (How) Can We Estimate the Ideology
of Citizens and Political Elites on the Same Scale?
\emph{American Journal of Political Science}.
Patz, Richard J. and Brian W. Junker. 1999. A Straightforward
Approach to Markov Chain Monte Carlo Methods for Item Response
Models. \emph{Journal of Education and Behavioral
......@@ -332,7 +344,7 @@ ideal(object, codes = object$codes,
Graphical Statistics}. 10(1):1-111.
}
\author{Simon Jackman \email{jackman@stanford.edu}, with help from Christina
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}, with help from Christina
Maimone and Alex Tahk.}
\seealso{
......
......@@ -102,7 +102,7 @@
(the derivative of the \code{gamma} function).
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{gamma}}, \code{\link{dgamma}},
\code{\link{pgamma}}, \code{\link{qgamma}}, \code{\link{uniroot}}}
......
......@@ -25,7 +25,7 @@
resolution.
}
\source{
Keith Poole, 107th Senate Roll Call Data. \url{ftp://voteview.com/sen107kh.ord} The Iraq vote is vote number 617.
Keith Poole, 107th Senate Roll Call Data. \url{https://voteview.com/static/data/out/votes/S107_votes.ord} The Iraq vote is vote number 617.
David Leip's Atlas of U.S. Presidential Elections. \url{http://uselectionatlas.org}
}
......
......@@ -19,7 +19,7 @@
\source{
Keith Poole's web site:
\url{http://voteview.com/senate110.htm}
\url{http://legacy.voteview.com/senate110.htm}
Originally scraped from the Senate's web site by Jeff Lewis.
......
......@@ -52,7 +52,7 @@ odTest(glmobj, alpha=.05, digits = max(3, getOption("digits") - 3))
Regressions. \emph{The Canadian Journal of Statistics}. 15:209-225.
}
\author{Simon Jackman \email{jackman@stanford.edu}. John Fox noted an
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}. John Fox noted an
error in an earlier version.}
\seealso{\code{\link[MASS:glm.nb]{glm.nb}}, \code{\link{logLik}}}
......
......@@ -35,7 +35,7 @@ pR2(object, ...)
}
\references{Long, J. Scott. 1997. \emph{Regression Models for Categorical and
Limited Dependent Variables}. Sage. pp104-106.}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{extractAIC}}, \code{\link{logLik}}}
\examples{
......
......@@ -22,5 +22,5 @@
into strings, via a table lookup in this data frame.}
\seealso{\code{\link{readKH}}
}
\source{Keith Poole's website: \url{http://voteview.com/PARTY3.HTM}}
\source{Keith Poole's website: \url{http://legacy.voteview.com/PARTY3.HTM}}
\keyword{datasets}
......@@ -37,7 +37,7 @@
After drawing plots on the current device, exits silently returning \code{invisible(NULL)}.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{predict.ideal}} \code{\link{ideal}} }
......
......@@ -58,7 +58,7 @@
\code{invisible{NULL}}.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{density}}, \code{\link{rug}}}
\examples{
data(ca2006)
......
......@@ -126,7 +126,7 @@ Rivers, Douglas. 2003. \dQuote{Identification of Multidimensional
Stanford University.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\note{Applying transformations to obtain identification can
sometimes lead to surprising results. Each data point makes the same
......
......@@ -27,7 +27,7 @@ predprob(obj, \dots)
(i.e., \code{min(y):max(y)}), conditional on the values of covariates.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{predprob.glm}}, \code{\link{predprob.zeroinfl}}}
......
......@@ -42,7 +42,7 @@
\code{newdata} is supplied, the returned matrix will have as many rows
as in \code{newdata}.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{predict.glm}}}
\examples{
data(bioChemists)
......
......@@ -24,7 +24,7 @@
A \code{\link{matrix}} of dimension \code{n} (number of legislators)
by \code{m} (number of roll call votes).
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{ideal}}, \code{\link{predprob}}, \code{\link{predict.ideal}}}
\examples{
f <- system.file("extdata","id1.rda",package="pscl")
......
\name{presidentialElections}
\alias{presidentialElections}
\docType{data}
\title{elections for U.S. President, 1932-2012, by state}
\title{elections for U.S. President, 1932-2016, by state}
\description{
Democratic share of the
presidential vote, 1932-2012, in each state and the District of Columbia.}
presidential vote, 1932-2016, in each state and the District of Columbia.}
\usage{data(presidentialElections)}
\format{
\itemize{
\item{state}{character, name of state}
\item{demVote}{numeric, percent of the vote for president won by the
\item{\code{state}}{character, name of state}
\item{\item{demVote}}{numeric, percent of the vote for president won by the
Democratic candidate}
\item{year}{numeric, integer}
\item{south}{logical, \code{TRUE} if state is one of the 11 states
\item{\item{year}}{numeric, integer}
\item{\item{south}}{logical, \code{TRUE} if state is one of the 11 states
of the former Confederacy}
}
}
......@@ -25,18 +25,20 @@
from 1964 onward; Alabama has missing data for 1948 and
1964.}
\source{David Leip's Atlas of U.S. Presidential Elections \url{http://uselectionsatlas.org}
\source{David Leip's Atlas of U.S. Presidential Elections \url{uselectionatlas.org}
}
\examples{
data(presidentialElections)
lattice::xyplot(demVote ~ year | state,
panel=panel.lines,
if(require(lattice)) {
lattice::xyplot(demVote ~ year | state,
panel=lattice::panel.lines,
ylab="Democratic Vote for President (percent)",
xlab="Year",
data=presidentialElections,
scales=list(y=list(cex=.6),x=list(cex=.35)),
strip=strip.custom(par.strip.text=list(cex=.6)))
}
## Obama vs Kerry, except DC
y08 <- presidentialElections$year==2008
......
......@@ -90,7 +90,7 @@ readKH(file,
\item{\code{partyName}}{character string, the name of each legislator's
political party}
\item{\code{party}}{numeric, code for each legislator's political
party; see \url{http://voteview.com/PARTY3.HTM}}
party; see \url{http://legacy.voteview.com/PARTY3.HTM}}
}
The \code{\link{rownames}} attribute of this data frame is a
concatenation of the legislators' names, party abbreviations (for
......@@ -133,7 +133,7 @@ readKH(file,
Political-Economic History of Roll Call Voting}. New York: Oxford
University Press.
Poole, Keith. \url{http://votevieW.COM}
Poole, Keith. \url{http://legacy.voteview.com}
Rosenthal, Howard L. and Keith T. Poole. \emph{United States Congressional
Roll Call Voting Records, 1789-1990: Reformatted Data [computer
......@@ -149,13 +149,13 @@ Consortium for Political and Social Research [distributor], 2000.
\examples{
\dontrun{
h107 <- readKH("ftp://voteview.com/hou107kh.ord",
h107 <- readKH("https://voteview.com/static/data/out/votes/H107_votes.ord",
desc="107th U.S. House of Representatives")
s107 <- readKH("ftp://voteview.com/sen107kh.ord",
s107 <- readKH("https://voteview.com/static/data/out/votes/S107_votes.ord",
desc="107th U.S. Senate")
}
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\keyword{datasets}
......@@ -19,12 +19,12 @@
\source{
Keith Poole's web site:
\url{http://voteview.com/senate109.htm}
\url{https://legacy.voteview.com/senate109.htm}
Originally scraped from the Senate's web site by Jeff Lewis (UCLA).
Information identifying the votes is available at
\url{ftp://voteview.com/dtaord/s109desc_final.csv}
\url{https://voteview.com/static/data/out/rollcalls/S109_rollcalls.csv}
}
\examples{
......@@ -37,10 +37,10 @@ summary(s109,verbose=TRUE)
\dontrun{
## how s109 was created
require(pscl)
s109 <- readKH("ftp://voteview.com/dtaord/sen109kh.ord",
s109 <- readKH("https://voteview.com/static/data/out/votes/S109_votes.ord",
desc="109th U.S. Senate",
debug=TRUE)
url <- "ftp://voteview.com/dtaord/s109desc_final.csv"
url <- "https://voteview.com/static/data/out/rollcalls/S109_rollcalls.csv"
s109$vote.data <- data.frame(read.csv(file=url,header=TRUE))
s109$vote.data$date <- as.Date(s109$vote.data$date,
......
......@@ -70,7 +70,7 @@ seatsVotes(x, desc = NULL, method = "uniformSwing")
1949-93. \emph{British Journal of Political Science}. 24(3):319-357.
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\note{Additional methods to come later.}
\seealso{\code{\link{plot.seatsVotes}} for plotting methods.}
......
......@@ -34,7 +34,7 @@ simpi(n)
\references{Ripley, Brain D. 1987 [2006]. \emph{Stochastic Simulation}.
Wiley: Hoboken, New Jersey.}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\examples{
seed <- round(pi*10000) ## hah hah hah
......
......@@ -86,7 +86,7 @@
\seealso{\code{\link{ideal}}}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\examples{
f <- system.file("extdata","id1.rda",package="pscl")
......
......@@ -43,7 +43,7 @@ vectorRepresentation(object, dropList = list(codes = c("missing", "notInLegis"))
\item{j}{the column of the roll call matrix \code{object$votes} that
supplied the \code{vote}; i.e., a unique identifier for the vote.}
}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\seealso{\code{\link{rollcall}}}
\examples{
data(s109)
......
......@@ -44,7 +44,7 @@ vuong(m1, m2, digits = getOption("digits"))
}
\references{Vuong, Q.H. 1989. Likelihood ratio tests for model
selection and non-nested hypotheses. \emph{Econometrica}. 57:307-333.}
\author{Simon Jackman \email{jackman@stanford.edu}}
\author{Simon Jackman \email{simon.jackman@sydney.edu.au}}
\examples{
data("bioChemists")
......@@ -55,7 +55,7 @@ vuong(glm1, zip)
\dontrun{
## compare negbin with zero-inflated negbin
nb1 <- glm.nb(art ~ ., data=bioChemists)
nb1 <- MASS::glm.nb(art ~ ., data=bioChemists)
zinb <- zeroinfl(art ~ . | ., data = bioChemists, dist = "negbin", EM = TRUE)
vuong(nb1, zinb)
}
......
......@@ -164,7 +164,7 @@ data("bioChemists", package = "pscl")
## ("art ~ ." is "art ~ fem + mar + kid5 + phd + ment")
fm_pois <- glm(art ~ ., data = bioChemists, family = poisson)
fm_qpois <- glm(art ~ ., data = bioChemists, family = quasipoisson)
fm_nb <- glm.nb(art ~ ., data = bioChemists)
fm_nb <- MASS::glm.nb(art ~ ., data = bioChemists)
## with simple inflation (no regressors for zero component)
fm_zip <- zeroinfl(art ~ . | 1, data = bioChemists)
......
......@@ -9,9 +9,6 @@
#include "util.h"
#include "ideal.h"
double**dvecTOdmat(double *vtr, double **dmtrx, int rows, int columns);
double *dmatTOdvec(double *vtr, double **dmtrx, int rows, int columns);
double *xxprod, **xxchol;
double *xz;
double *bxprod, **bchol;
......@@ -25,7 +22,8 @@ void IDEAL(int *n1, int *m1, int *d1, double *y1, int *maxiter1, int *thin1,
int *impute1, int *mda, double *xpriormeans1,
double *xpriorprec1, double *bpriormeans1, double *bpriorprec1,
double *xstart1, double *bstart1, double *xoutput, double *boutput,
int *burnin1, int *usefile, int *bsave, char **filename1, int *verbose1)