Commit 7a182d1c authored by Christopher Lawrence's avatar Christopher Lawrence Committed by Andreas Tille

Import Debian changes 1.4.8-1

r-cran-pscl (1.4.8-1) unstable; urgency=medium

  * New upstream release.
parents c0a111c4 1bca908a
Package: pscl
Version: 1.4.6
Date: 2014-08-23
Version: 1.4.8
Date: 2015-01-21
Title: Political Science Computational Laboratory, Stanford University
Author: Simon Jackman, with contributions from
Alex Tahk, Achim Zeileis, Christina Maimone and Jim Fearon
Maintainer: Simon Jackman <jackman@stanford.edu>
Depends: R (>= 2.10.0), MASS, lattice
Suggests: MCMCpack, car, lmtest, sandwich, zoo, coda, gam, vcd, mvtnorm
Depends: MASS, lattice
Suggests: MCMCpack, car, lmtest, sandwich, zoo, coda, vcd, mvtnorm,
mgcv
Enhances: stats
Description: Bayesian analysis of item-response theory (IRT) models,
roll call analysis; computing highest density regions; maximum
......@@ -17,7 +18,7 @@ Description: Bayesian analysis of item-response theory (IRT) models,
LazyData: true
License: GPL-2
URL: http://pscl.stanford.edu/
Packaged: 2014-08-25 06:04:42 UTC; jackman
NeedsCompilation: yes
Packaged: 2015-01-23 19:59:54 UTC; jackman
Repository: CRAN
Date/Publication: 2014-08-27 18:02:01
Date/Publication: 2015-01-24 06:45:25
05e0502270b3b120ed299ff6d13cf936 *DESCRIPTION
df97f4d11c2a3b38575fd9fe3da1c93d *NAMESPACE
705cfb981ccff4c396219d24f9b34bbf *NEWS
43e79a8ef077fbf41b5a5c6830083cd1 *DESCRIPTION
89628c3574f457f849e2ed6718891e58 *NAMESPACE
cc1aeb8117df184ea9888c8f8e18c6de *NEWS
e4141b58125086fe7a925a18a27fbf13 *R/betaHPD.r
fa1ccedd12e25d0f4b57c837eee688c5 *R/dropRollCall.r
9136707d4c7f8400c1581139132014eb *R/dropUnanimous.r
2d2ad2f4dd964d982bfb1b039913a847 *R/extractVotes.r
3a3b87569b3f7fbd008cd1d6553fdb32 *R/hello.r
a68a2ed5e435379d9dbabf719ae32701 *R/hitmiss.R
ed0e60f8f2df4e1f70be74fdff483bd0 *R/hurdle.R
9ca24581779dbb144ae08119ccdc0a4f *R/hurdle.R
744d1af6de3d20aa2928bf77bef07b34 *R/ideal.r
24cfd3cf6b0498e16ab9a08a5ed63fd4 *R/idealHelper.r
57c42afc03bc7b48bf57aad15e6b5696 *R/igamma.r
......@@ -15,7 +15,7 @@ ed0e60f8f2df4e1f70be74fdff483bd0 *R/hurdle.R
7f33ab0717237682733911d1f50370b2 *R/ntable.R
e96a2d20824383196b8b7a6132dcaf2f *R/odTest.R
2ccee1a9ff1cb45ad9c41aa072876814 *R/pi.r
aea47b7871d6bb1fce7c9cc57b864a75 *R/plot.ideal.r
e3b6c911f880d8af6a8a675c3f10d812 *R/plot.ideal.r
e0d535a36192a68399200a5d7b2a43bd *R/postProcess.r
6b47bc9b373b1187662fef8941e5e91a *R/predict.ideal.r
d3423d8e4fb2d372947e30b5fbf0e0b1 *R/predprob.R
......@@ -28,7 +28,7 @@ a14694458a410c3ff8fd70647009f54f *R/pseudoRSq.R
8181536f4cdf5dd0217ad9ead60c3546 *R/summary.ideal.r
582616ad7c65d4a16d29a64d5acbb338 *R/sysdata.rda
0202cd83b23bb8c999f9d270f6e210a9 *R/toMCMC.r
1e7b8598728651c32a2b3de1876619cd *R/vuong.R
0e293b70ae0e789dfea1b28f9da5fd5a *R/vuong.R
96200a090cd18b7ded8e555771ff6cab *R/zeroinfl.R
bdfbae70de1517193e1dfb8740fe01e8 *R/zzz.R
53313b6f0b69be68a1fc8770c9ef7eb0 *README
......@@ -54,80 +54,80 @@ b51d0806c46e14ed3661fb47d1048087 *data/sc9497.rda
713f3c337726d96eb138ef220289a4d8 *data/state.info.rda
d7638296db19c4ba7de8ffa89d4d144c *data/unionDensity.rda
497a2fb245ca5588e562ba3efa9fd73f *data/vote92.rda
b1684d7631e2aaf9b870b79adae6832f *inst/CITATION
0e5bc65ba111038adf4e4c6accccb148 *inst/CITATION
6e55e6571f5729f76216ca3212ad5686 *inst/COPYRIGHTS
40e6573aad40b503ce7dc384664fd00a *inst/doc/countreg.R
f0b2acaed3829613387d308477b32cfb *inst/doc/countreg.Rnw
79954db5339de91063e891c3fc8c95fc *inst/doc/countreg.pdf
6a339e8576cd23b19769209a0f46d0c6 *inst/extdata/id1.RData
4c24fa4db587d5b00a0b7b935fda0dd6 *inst/extdata/id2.RData
1f374780d3fdab077448b3f8c8ed4535 *man/AustralianElectionPolling.Rd
29d5bfaff9d65c4dece16ac2f9d2bb21 *inst/doc/countreg.pdf
6a339e8576cd23b19769209a0f46d0c6 *inst/extdata/id1.rda
4c24fa4db587d5b00a0b7b935fda0dd6 *inst/extdata/id2.rda
241e9b4fa6479e6a2797caa63de9474e *man/AustralianElectionPolling.Rd
4c7220ae568fc8650e5a083ecfe61751 *man/AustralianElections.Rd
413c8bb8c2a97bf96a086752b64f9727 *man/EfronMorris.Rd
8d936782297f143d7b583f58fc5b6ac7 *man/RockTheVote.Rd
e530063893fe76e74d0bce2443647932 *man/UKHouseOfCommons.Rd
c129da4f0e4ec6908b9531e176bcc34e *man/absentee.Rd
b9cb4d068d5fc84d36ed325816c8a561 *man/admit.Rd
29d9d91a13b93cea56ea59556ab7c042 *man/admit.Rd
21e2df080979a911fe55565ee1cbb02f *man/betaHPD.Rd
67cb83cb4c84b23f9601d663877deebf *man/bioChemists.Rd
97530d29c9ef5df8617be6703bbcb364 *man/ca2006.Rd
a68714c5007d455e2c81adc994d3b909 *man/bioChemists.Rd
cc1e66c3332df10e6f591fce766fcf26 *man/ca2006.Rd
83a1c4252ad2a97f2701495bd0d2d282 *man/computeMargins.Rd
66c9b2b50681323d41551fa35a474546 *man/constrain.items.Rd
672d8bd2128fecb26481b860fe6ae8b9 *man/constrain.items.Rd
fadebde0593ea59b498a94c0211a12b3 *man/constrain.legis.Rd
3332b1e2c6825660602c04ad75f6392d *man/convertCodes.Rd
5a954aadd19f2814e98c8848232de93e *man/dropRollCall.Rd
1bfa8bbb776eeae989dcb4ffa590a156 *man/dropUnanimous.Rd
28ce5c278e745ae69f098c5c531ebaed *man/extractRollCallObject.Rd
8f9d49ad6015aa110605fc21109b1ca5 *man/hitmiss.Rd
b40955b042264da352b1c9a28db81367 *man/extractRollCallObject.Rd
4eda758694941f40c5f07f81a3e6c4c0 *man/hitmiss.Rd
edc14a2d7f63d105e16a7224ea866e2b *man/hurdle.Rd
a2cdd121c20655dbec00738598efed1a *man/hurdle.control.Rd
ef97a6fcfb782e3b64be0429cf7a7680 *man/hurdletest.Rd
a22f5674eb8deddacfdb9d26e617d38a *man/ideal.Rd
efba2fcd19078b3db9df598784028948 *man/idealToMCMC.Rd
c4c622f7c88d1002e816748a4119c3d1 *man/ideal.Rd
3600fd3654a969adad8579f652d31f6b *man/idealToMCMC.Rd
f18d51d590ed9904dfe6e41571fe3903 *man/igamma.Rd
bf033f0cb311d0b1415b2364e03705b8 *man/iraqVote.Rd
ad0ccd84450a594df90119fa3ef8461e *man/nj07.Rd
078b921a42e58dd7330c8df04d127fed *man/ntable.Rd
ae425651938177afa50dc1f8e030164c *man/odTest.Rd
748fa0a8a2f3e24b7ad7708726a88da6 *man/pR2.Rd
99951244af04af9a168419c38096b60b *man/partycodes.Rd
549c790a485bfabb8255f84012bc67f6 *man/plot.ideal.Rd
6c060e244893bb16b4dc5741ac672969 *man/plot.predict.ideal.Rd
d5c363e1fe405fbf6195e5c9eefaccc9 *man/odTest.Rd
69f6ccaf04208df5fe3928e50d083c0c *man/pR2.Rd
77475a5df7b02380b10825a3a2cb3ba0 *man/partycodes.Rd
6718cf57247c5b1f8014a910dfca913f *man/plot.ideal.Rd
7a7b798e6b929d3dbcb683c4237a6e19 *man/plot.predict.ideal.Rd
cd69945b628a1030c3a361b23b04d75a *man/plot.seatsVotes.Rd
02504e6bd8296294f2ed8ce69334bf30 *man/politicalInformation.Rd
5b2f85ca008eadbd667dbdd478493b69 *man/postProcess.Rd
2ccf3091adfc516be0ea80ca28cc644a *man/politicalInformation.Rd
c7178faa31d82f406f3fb74ec48bf568 *man/postProcess.Rd
589a61aaef2ea8a77cada485036f1685 *man/predict.hurdle.Rd
b2ce558820a4ad6140fc82be663d0b37 *man/predict.ideal.Rd
6b951d97195a160359bda125c1b40a1f *man/predict.ideal.Rd
d43b9cc311c2a17ff678c6b1e2fa95e8 *man/predict.zeroinfl.Rd
2cc067fd655c891057604ddecd7f7be2 *man/predprob.Rd
6f0d72cddc3d45b83d09074b77aa7e48 *man/predprob.glm.Rd
9939090df9d59afebb2e2948657c3bf2 *man/predprob.ideal.Rd
95716587f1ef0d16b2e5472f6b6bee5d *man/presidentialElections.Rd
48f1b6ea440c1204bd0174b5797117a2 *man/predprob.ideal.Rd
a22a7a5aa542cb93ec7faec4bc5c2b7e *man/presidentialElections.Rd
40b952f533b01527691b62c22fa1b757 *man/prussian.Rd
0f6b51ad8d37d90b677951c4f67c34c7 *man/readKH.Rd
152237c0100227ababd000ed34b6a0d8 *man/readKH.Rd
3ed90ebe8e28b86cfff88c7b9d3a1d1f *man/rollcall.Rd
a7eef4fbf81a2e82d8f9d537c99c1811 *man/s109.Rd
72a08641f0d2079920248278a9939a43 *man/s109.Rd
020d6e0155cef909fe932536998bc684 *man/sc9497.Rd
b72ce8933d92ee28c1a4fa7cf7eb6b6e *man/seatsVotes.Rd
23bff5995d683d5bf95bce59ca47fa86 *man/simpi.Rd
c351971ed35a4a7c1e81d26048e239a9 *man/state.info.Rd
09ea85f6b8ef9bfa80769c827be48770 *man/summary.ideal.Rd
69d21844fd8dd6c2a445302c84d210ff *man/summary.rollcall.Rd
b997e43520c34b348b421bc09ab0f900 *man/tracex.Rd
69035aa534f90a3b5108811e91b19ff1 *man/tracex.Rd
2531fcd99d3935897ec347c7d298b84e *man/unionDensity.Rd
77fc48107d0d11045b2db0538a11c58f *man/vectorRepresentation.Rd
e98499c1ce4c6b994fa946375f650bfb *man/vote92.Rd
6a12cba9f9b223ddc5178fee00e5844d *man/vuong.Rd
d99ea50412dc5118c5da55dfe24bbc8a *man/vuong.Rd
0b67233ce3f099152201d376e3adacd9 *man/zeroinfl.Rd
a71cbe2fdb4bfc8d678f4fbfaa36f6ca *man/zeroinfl.control.Rd
0953c7aa5829590a2617b4dac3014937 *src/IDEAL.c
668efb9f161d87d30940d1861045609f *src/IDEAL.c
c1242e2c0dc49254b3103abcaa3fce43 *src/bayesreg.c
84fc8d596f9ed6fff436213f5aa0176b *src/check.c
7827d05ccbfda37a6770d1893ad2657a *src/chol.c
54b5d46b82a2d8d1b711265ae6976ca7 *src/chol.h
27ff6dd23ef01d1b20ebf152634ab2c1 *src/crossprod.c
1f8e2127a3bc9a7c043c7866722a992d *src/crossprod.c
b5cfc01c17e0d459aea4d5c7a4324059 *src/dmatTOdvec.c
a7ecc84c2418f8dc0172832f52b49d0d *src/dtnorm.c
78d3a70564caa02683b095ed93499636 *src/dtnorm.c
535fd3e635d6d566fe6b826003974385 *src/dvecTOdmat.c
e2caa6a2b8babf8fbddf2a38162dce82 *src/gaussj.c
a0ce9dacf3232a1b44ae9751b3576157 *src/ideal.h
......@@ -140,7 +140,7 @@ dcd975bec5ddba470e1db440563859b5 *src/rigamma.c
c0fdc0b2f60d730bba7f5fbd6170d4f1 *src/updateb.c
dc84510ecda25f2d02511578e209f40c *src/updatex.c
13831bf39bc2ae096899c94239770c9b *src/updatey.c
419ed48fd112dd27f0dea33ed73b0d5c *src/util.c
f0fa7ad3f866127695ddaa8dbb9256cc *src/util.c
4531f2dfbc17c8f2f692de0e7c97b7c7 *src/util.h
5967f2c183b3301343fe317875a181bc *src/xchol.c
21805fdd82f57d48144b119f84e73219 *src/xreg.c
......
......@@ -28,8 +28,10 @@ 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("lattice", "xyplot")
## methods for class zeroinfl
S3method("print", "zeroinfl")
......
1.4.8 * package dependcies handled better
* slight tweeks to ideal help
* CRAN compliance
* addressing memory leak issues revealed by valgrind in ideal's mallocs
1.4.7 * AIC and BIC in Vuong, better description and printing
1.4.6 * compliance with CRAN recss/reqs, vignettes sub-dir
* better Imports/Depends/Suggests etc
* dropped redundant "require" in examples etc
......@@ -41,7 +48,7 @@
1.03.7 * small bug in constrain.item (reported by Paul Johnson)
* change normalization option in ideal to generate posterior means with mean 0, sd 1
* do normalization over all dimensions
* typos in documentation for pseudo-R2 (thanks to Henrik Pärn)
* typos in documentation for pseudo-R2 (thanks to Henrik P?rn)
1.03.6 * made gam dependency explicit
* change linear.hypothesis to linearHypothesis
......@@ -179,7 +186,7 @@
* finally changed ideal model to have a negative intercept; required changes to
updatex.c, updatey.c, and xreg.c
0.72 * fixed error in bioChemists data found by Bettina Grün
0.72 * fixed error in bioChemists data found by Bettina Gr?n
<gruen@ci.tuwien.ac.at>, variable kids5 was off by 1 unit, now runs
from min of zero (no kids).
......@@ -270,8 +277,8 @@
add coda to list of required packages
error in negative binomial hurdle model, added theta to coefficients dimnames
added TODO file to top-level directory of package
fixed bug in print.zeroinfl (thanks to Bettina Grün <gruen@ci.tuwien.ac.at>)
bugs in zeroinfl (Bettina Grün <gruen@ci.tuwien.ac.at>)
fixed bug in print.zeroinfl (thanks to Bettina Gr?n <gruen@ci.tuwien.ac.at>)
bugs in zeroinfl (Bettina Gr?n <gruen@ci.tuwien.ac.at>)
corrected spelling of Ginsb*u*rg in sc9497 (Supreme Court sample data)
0.55 added ideal point estimation (Alex Tahk)
......
......@@ -689,7 +689,7 @@ hurdletest <- function(object, ...) {
stopifnot(inherits(object, "hurdle"))
stopifnot(object$dist$count == object$dist$zero)
stopifnot(all(sort(names(object$coefficients$count)) == sort(names(object$coefficients$zero))))
stopifnot(require("car"))
stopifnot(requireNamespace("car"))
nam <- names(object$coefficients$count)
lh <- paste("count_", nam, " = ", "zero_", nam, sep = "")
rval <- car::linearHypothesis(object, lh, ...)
......
......@@ -427,7 +427,7 @@ tracex <- function(object,
if(!multi){ ## plot all 2d traces at once
xRange <- range(unlist(lapply(meat,function(x)x$x)),na.rm=TRUE)
yRange <- range(unlist(lapply(meat,function(x)x$y)),na.rm=TRUE)
require(graphics)
layout(mat=matrix(c(1,2),1,2,byrow=TRUE),
widths=c(.7,.3))
......
......@@ -12,12 +12,12 @@
"Model 1 has ",m1n," observations.\n",
"Model 2 has ",m2n," observations.\n",
sep="")
)
)
if(any(m1y != m2y)){
stop(paste("Models appear to have different values on dependent variables.\n"))
stop(paste("Models appear to have different values on dependent variables.\n"))
}
whichCol <- match(m1y,min(m1y):max(m1y)) ## which column, matrix of predicted probs
m1p <- rep(NA,m1n)
......@@ -29,49 +29,59 @@
m2p[i] <- p2[i,whichCol[i]]
}
## gather up degrees of freedom
k1 <- length(coef(m1))
k2 <- length(coef(m2))
m <- log(m1p) - log(m2p) ## vector of log likelihood ratios (diffs of log probabilities)
bad <- is.na(m) | is.nan(m) | is.infinite(m)
neff <- sum(!bad)
if(any(bad)){
cat("NA or numerical zeros or ones encountered in fitted probabilities\n")
cat("dropping these cases, but proceed with caution\n")
cat(paste("dropping these",sum(bad),"cases, but proceed with caution\n"))
}
## gather up degrees of freedom
k1 <- length(coef(m1))
k2 <- length(coef(m2))
## test statistic
msum <- sum(m[!bad])
aic.factor <- (k1-k2)/neff
bic.factor <- (k1-k2)/2 * log(neff)
print(bic.factor)
## test statistics
v <- rep(NA,3)
L1 <- sum(log(m1p[!bad]))
L2 <- sum(log(m2p[!bad]))
num <- rep(L1-L2,3) - c(0,aic.factor,bic.factor)
s <- sd(m[!bad])
v <- msum/(s * sqrt(neff))
adj <- log(neff)*(k1/2 - k2/2) ## adjustment a la AIC, length of model(s)
v <- v - adj
v <- num/(s*sqrt(neff))
names(v) <- c("Raw","AIC-corrected","BIC-corrected")
print(v)
print(s)
print(num)
## bundle up for output
pval <- rep(NA,3)
msg <- rep("",3)
for(j in 1:3){
if(v[j]>0){
pval[j] <- 1 - pnorm(v[j])
msg[j] <- "model1 > model2"
} else {
pval[j] <- pnorm(v[j])
msg[j] <- "model2 > model1"
}
}
out <- data.frame(v,msg,format.pval(pval))
names(out) <- c("Vuong z-statistic","H_A","p-value")
## output
cat(paste("Vuong Non-Nested Hypothesis Test-Statistic:",
signif(v,digits),
"\n"))
cat("(test-statistic is asymptotically distributed N(0,1) under the\n")
cat(" null that the models are indistinguishible)\n")
if(v>0){
pval <- 1 - pnorm(v)
} else {
pval <- pnorm(v)
}
cat("-------------------------------------------------------------\n")
cat("in this case:\n")
if(v>0)
cat(paste("model1 > model2, with p-value",
format.pval(pval),
"\n"))
else
cat(paste("model2 > model1, with p-value",
format.pval(pval),
"\n"))
invisible(NULL)
print(out)
return(invisible(NULL))
}
r-cran-pscl (1.4.8-1) unstable; urgency=medium
* New upstream release.
-- Chris Lawrence <lawrencc@debian.org> Sun, 08 Mar 2015 17:30:30 -0400
r-cran-pscl (1.4.6-1) unstable; urgency=medium
* New upstream release.
......
......@@ -3,7 +3,7 @@ Section: gnu-r
Priority: optional
Maintainer: Chris Lawrence <lawrencc@debian.org>
Build-Depends: debhelper (>> 9), cdbs, r-base-dev (>= 3.0), r-cran-mass, r-cran-mvtnorm (>= 0.7.5-2), r-cran-coda, r-cran-lattice, r-cran-gam, dpkg-dev (>= 1.16.1~), r-cran-vcd (>= 1:1.2-13), r-cran-colorspace (>= 1.2-2)
Standards-Version: 3.9.5
Standards-Version: 3.9.6
Homepage: http://pscl.stanford.edu/
Package: r-cran-pscl
......
citHeader("To cite pscl/ideal in publications use")
## R >= 2.8.0 passes package metadata to citation().
if(!exists("meta") || is.null(meta)) meta <- packageDescription("pscl")
##if(!exists("meta") || is.null(meta)) meta <- packageDescription("pscl")
year <- sub("-.*", "", meta$Date)
note <- sprintf("R package version %s", meta$Version)
......
No preview for this file type
......@@ -42,7 +42,7 @@ The ALP changed leaders twice in the 2004-07 inter-election period spanned by th
}
\examples{
data(AustralianElectionPolling)
xyplot(ALP ~ startDate | org,
lattice::xyplot(ALP ~ startDate | org,
data=AustralianElectionPolling,
layout=c(1,5),
type="b",
......@@ -50,11 +50,10 @@ xyplot(ALP ~ startDate | org,
ylab="ALP")
## test for house effects
library(gam)
y <- AustralianElectionPolling$ALP/100
v <- y*(1-y)/AustralianElectionPolling$sampleSize
w <- 1/v
m1 <- gam(y ~ lo(startDate,span=1/10),
m1 <- mgcv::gam(y ~ s(as.numeric(startDate)),
weight=w,
data=AustralianElectionPolling)
m2 <- update(m1, ~ . + org)
......
......@@ -31,7 +31,7 @@
data(admit)
summary(admit)
## ordered probit model
op1 <- polr(score ~ gre.quant + gre.verbal + ap + pt + female,
op1 <- MASS::polr(score ~ gre.quant + gre.verbal + ap + pt + female,
Hess=TRUE,
data=admit,
method="probit")
......
......@@ -17,7 +17,7 @@
\item{\code{ment}}{count of articles produced by Ph.D. mentor during last 3 years}
}
}
\source{found in Stata format at \url{http://www.indiana.edu/~jslsoc/stata/socdata/couart2.dta}}
%%\source{found in Stata format at \url{http://www.indiana.edu/~jslsoc/stata/socdata/couart2.dta}}
\references{Long, J. Scott. 1990. The origins of sex differences in
science. \emph{Social Forces}. 68(3):1297-1316.
......
......@@ -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://vote2006.sos.ca.gov/Returns/usrep/all.htm}.
%%Excel data at \url{http://www.sos.ca.gov/elections/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.
......
......@@ -81,7 +81,7 @@ constrain.items(obj, dropList = list(codes = "notInLegis", lop = 0),
\examples{
\dontrun{
data(s109)
f <- system.file("extdata","id1.Rdata",package="pscl")
f <- system.file("extdata","id1.rda",package="pscl")
load(f)
id1sum <- summary(id1,include.beta=TRUE)
suspect1 <- id1sum$bSig[[1]]=="95% CI overlaps 0"
......
......@@ -29,7 +29,7 @@ extractRollCallObject(object)
details on the form of a \code{dropList}.}
\examples{
data(s109)
f = system.file("extdata","id1.RData",package="pscl")
f = system.file("extdata","id1.rda",package="pscl")
load(f)
tmp <- extractRollCallObject(id1)
summary(tmp)
......
......@@ -61,7 +61,7 @@ hitmiss(obj, digits = max(3, getOption("digits") - 3), ...)
\examples{
data(admit)
## ordered probit model
op1 <- polr(score ~ gre.quant + gre.verbal + ap + pt + female,
op1 <- MASS::polr(score ~ gre.quant + gre.verbal + ap + pt + female,
Hess=TRUE,
data=admit,
method="probit")
......
......@@ -119,7 +119,7 @@ ideal(object, codes = object$codes,
For one-dimensional models (i.e., \code{d=1}), a simple route to
identification is the \code{normalize} option, by imposing the restriction that the means of the posterior densities of the ideal points (ability parameters) have mean zero and standard deviation one, across legislators (test-takers). This normalization supplies
\emph{local} identification (identification up to a 180 rotation of
\emph{local} identification (that is, identification up to a 180 degree rotation of
the recovered dimension).
Near-degenerate \dQuote{spike} priors
......@@ -129,10 +129,10 @@ ideal(object, codes = object$codes,
Identification in higher dimensions can be obtained by supplying
fixed values for \code{d+1} legislators' ideal points, provided the
supplied points span a \code{d}-dimensional space (e.g., three
supplied fixed points span a \code{d}-dimensional space (e.g., three
supplied ideal points form a triangle in \code{d=2} dimensions), via
the \code{\link{constrain.legis}} option. In this case the function
defaults to vague normal priors, but at each iteration the sampled
defaults to vague normal priors on the unconstrained ideal points, but at each iteration the sampled
ideal points are transformed back into the space of identified
parameters, applying the linear transformation that maps the
\code{d+1} fixed ideal points from their sampled values to their
......@@ -144,20 +144,20 @@ ideal(object, codes = object$codes,
Another route to identification is via \emph{post-processing}. That
is, the user can run \code{ideal} without any identification
constraints (which does not pose any formal/technical problem in a
Bayesian analysis -- the posterior density is still well defined and
can be explored via MCMC methods) -- but then use the function
constraints. This does not pose any formal/technical problem in a
Bayesian analysis. The fact that the posterior density may have
mulitple modes doesn't imply that the posterior is improper or that
it can't be explored via MCMC methods. -- but then use the function
\code{\link{postProcess}} to map the MCMC output from the space of
unidentified parameters into the subspace of identified parameters.
See the example in the documentation for the
\code{\link{postProcess}} function.
When the
\code{normalize} option is set to \code{TRUE}, an unidentified model
is run, and the \code{ideal} object is post-processed with the
\code{normalize} option, and then returned to the user (but again,
note that the \code{normalize} option is only implemented for
unidimensional models).
When the \code{normalize} option is set to \code{TRUE}, an
unidentified model is run, and the \code{ideal} object is
post-processed with the \code{normalize} option, and then returned
to the user (but again, note that the \code{normalize} option is
only implemented for unidimensional models).
\strong{Start values}. Start values can be supplied by the user, or
generated by the function itself.
......@@ -180,20 +180,20 @@ ideal(object, codes = object$codes,
conditionally independent given each legislator's latent
preference), and the (constrained or unconstrained) start values for
legislators are used as predictors. The estimated coefficients from
these probit models are stored to serve as start values for the item
these probit models are used as start values for the item
discrimination and difficulty parameters (with the intercepts from
the probit GLMs multiplied by -1 so as to make those coefficients
difficulty parameters).
The default \code{eigen} method generates extremely good start values
for low-dimensional models fit to recent U.S. congresses (where high
rates of party line voting result in excellent fits from low dimensional models). The
\code{eigen} method may be computationally expensive or even
impossible to implement for \code{rollcall} objects with large numbers
of legislators.
The default \code{eigen} method generates extremely good start
values for low-dimensional models fit to recent U.S. congresses,
where high rates of party line voting result in excellent fits from
low dimensional models. The \code{eigen} method may be
computationally expensive or lead to memory errors for
\code{rollcall} objects with large numbers of legislators.
The \code{random} method generates start values via iid sampling
from a N(0,1) density, via \code{\link{rnorm}}, imposes any
from a N(0,1) density, via \code{\link{rnorm}}, imposing any
constraints that may have been supplied via
\code{\link{constrain.legis}}, and then uses the probit method
described above to get start values for the rollcall/item
......@@ -231,13 +231,12 @@ ideal(object, codes = object$codes,
\eqn{(\beta,\alpha)} are extremely simple to sample from; see the
references for details.
This data-augmented Gibbs sampling strategy is easily implemented, but can sometimes
require many thousands of samples in order to generate tolerable
explorations of the posterior densities of the latent
traits, particularly for legislators with
short and/or extreme voting histories (the equivalent in the
educational testing setting is a test-taker who gets many items
right or wrong).
This data-augmented Gibbs sampling strategy is easily implemented,
but can sometimes require many thousands of samples in order to
generate tolerable explorations of the posterior densities of the
latent traits, particularly for legislators with short and/or
extreme voting histories (the equivalent in the educational testing
setting is a test-taker who gets almost every item right or wrong).
% The MCMC algorithm can generate better performance
% via a parameter expansion strategy usually referred to as \emph{marginal
......@@ -279,14 +278,14 @@ ideal(object, codes = object$codes,
an interval of \code{thin}.}
\item{beta}{a three-dimensional \code{\link{array}} containing the
MCMC output for the item parameters. The three-dimensional array is
in iteration-rollcall-parameter order. The iterations run from \code{burnin} to \code{maxiter}, at
an interval of \code{thin}. Each rollcall has \code{d+1}
parameters, with the item-discrimination parameters stored first, in
the first \code{d} components of the 3rd dimension of the
\code{beta} array; the item-difficulty parameter follows in the
final \code{d+1} component of the 3rd dimension of the \code{beta}
array.}
MCMC output for the item parameters. The three-dimensional array
is in iteration-rollcall-parameter order. The iterations run from
\code{burnin} to \code{maxiter}, at an interval of \code{thin}.
Each rollcall has \code{d+1} parameters, with the
item-discrimination parameters stored first, in the first \code{d}
components of the 3rd dimension of the \code{beta} array; the
item-difficulty parameter follows in the final \code{d+1}
component of the 3rd dimension of the \code{beta} array.}
\item{xbar}{a \code{n} by \code{d} \code{\link{matrix}} containing the means of the
MCMC samples for the ideal point of each legislator in each dimension,
......
......@@ -39,7 +39,7 @@ idealToMCMC(object, burnin=NULL)
\examples{
data(s109)
f = system.file("extdata",package="pscl","id1.RData")
f = system.file("extdata",package="pscl","id1.rda")
load(f)
id1coda <- idealToMCMC(id1)
summary(id1coda)
......
......@@ -59,7 +59,7 @@ odTest(glmobj, alpha=.05, digits = max(3, getOption("digits") - 3))
\examples{
data(bioChemists)
modelnb <- glm.nb(art ~ .,
modelnb <- MASS::glm.nb(art ~ .,
data=bioChemists,
trace=TRUE)
odTest(modelnb)
......
......@@ -41,7 +41,7 @@ pR2(object, ...)
\examples{
data(admit)
## ordered probit model
op1 <- polr(score ~ gre.quant + gre.verbal + ap + pt + female,
op1 <- MASS::polr(score ~ gre.quant + gre.verbal + ap + pt + female,
Hess=TRUE,
data=admit,
method="probit")
......
......@@ -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.dat}}
\source{Keith Poole's website: \url{http://voteview.com/PARTY3.HTM}}
\keyword{datasets}
......@@ -99,6 +99,7 @@ plot2d(x, d1=1, d2=2, burnin=NULL,
diagnosing convergence of the MCMC algorithms.}
\examples{
\dontrun{
data(s109)
id1 <- ideal(s109,
d=1,
......@@ -110,7 +111,7 @@ id1 <- ideal(s109,
plot(id1)
\dontrun{
id2 <- ideal(s109,
d=2,
store.item=TRUE,
......
......@@ -43,7 +43,7 @@
\examples{
data(s109)
f = system.file("extdata","id1.RData",package="pscl")
f = system.file("extdata","id1.rda",package="pscl")
load(f)
phat <- predict(id1)
plot(phat,type="legis")
......
......@@ -46,7 +46,7 @@ data(politicalInformation)
table(politicalInformation$y,exclude=NULL)
op <- polr(y ~ collegeDegree + female + log(age) + homeOwn + govt + log(length),
op <- MASS::polr(y ~ collegeDegree + female + log(age) + homeOwn + govt + log(length),
data=politicalInformation,
Hess=TRUE,
method="probit")
......
......@@ -155,7 +155,7 @@ Stanford University.
\examples{
data(s109)
f = system.file("extdata",package="pscl","id1.RData")
f = system.file("extdata",package="pscl","id1.rda")
load(f)
id1Local <- postProcess(id1) ## default is to normalize
......@@ -166,7 +166,7 @@ id1pp <- postProcess(id1,
summary(id1pp)
## two-dimensional fit
f = system.file("extdata",package="pscl","id2.RData")
f = system.file("extdata",package="pscl","id2.rda")
load(f)
id2pp <- postProcess(id2,
......
......@@ -84,20 +84,8 @@
\examples{
data(s109)
\dontrun{
id1 <- ideal(s109,
normalize=TRUE,
store.item=TRUE) ## too long for examples
}
id1 <- ideal(s109,
d=1,
normalize=TRUE,
store.item=TRUE, ## need this to be TRUE for predict
maxiter=500,
burnin=100,
thin=10)
f <- system.file("extdata","id1.rda",package="pscl")
load(f)
phat <- predict(id1)
phat ## print method
}
......
......@@ -27,14 +27,8 @@
\author{Simon Jackman \email{jackman@stanford.edu}}
\seealso{\code{\link{ideal}}, \code{\link{predprob}}, \code{\link{predict.ideal}}}
\examples{
data(s109)
id1 <- ideal(s109,
d=1,
normalize=TRUE,
store.item=TRUE,
maxiter=500,
burnin=100,
thin=10)
f <- system.file("extdata","id1.rda",package="pscl")
load(f)
phat <- predprob(id1)
dim(phat)
}
......
......@@ -30,7 +30,7 @@
\examples{
data(presidentialElections)
xyplot(demVote ~ year | state,
lattice::xyplot(demVote ~ year | state,
panel=panel.lines,
ylab="Democratic Vote for President (percent)",
xlab="Year",
......
......@@ -133,14 +133,15 @@ readKH(file,
Political-Economic History of Roll Call Voting}. New York: Oxford
University Press.
Poole, Keith. \url{http://voteview.ucsd.edu}
Poole, Keith. \url{http://votevieW.COM}
Rosenthal, Howard L. and Keith T. Poole. \emph{United States Congressional
Roll Call Voting Records, 1789-1990: Reformatted Data [computer
file].} 2nd ICPSR release. Pittsburgh, PA: Howard L. Rosenthal and Keith