Title: | Recovering a Basic Space from Issue Scales |
---|---|
Description: | Provides functions to estimate latent dimensions of choice and judgment using Aldrich-McKelvey and Blackbox scaling methods, as described in Poole et al. (2016, <doi:10.18637/jss.v069.i07>). These techniques allow researchers (particularly those analyzing political attitudes, public opinion, and legislative behavior) to recover spatial estimates of political actors' ideal points and stimuli from issue scale data, accounting for perceptual bias, multidimensional spaces, and missing data. The package uses singular value decomposition and alternating least squares (ALS) procedures to scale self-placement and perceptual data into a common latent space for the analysis of ideological or evaluative dimensions. Functionality also include tools for assessing model fit, handling complex survey data structures, and reproducing simulated datasets for methodological validation. |
Authors: | Royce Carroll [aut], Christopher Hare [aut, cre], Jeffrey B. Lewis [aut], James Lo [aut], Keith T. Poole [aut], Howard Rosenthal [aut] |
Maintainer: | Christopher Hare <[email protected]> |
License: | GPL-2 |
Version: | 0.25 |
Built: | 2024-12-04 06:54:00 UTC |
Source: | CRAN |
aldmck
is a function that takes a matrix of perceptual data, such as
liberal-conservative rankings of various stimuli, and recovers the true
location of those stimuli in a spatial model. It differs from procedures
such as wnominate
, which instead use preference data to estimate
candidate and citizen positions. The procedure here, developed by John
Aldrich and Richard McKelvey in 1977, is restricted to estimating data
with no missing values and only in one dimension. Please refer to the
blackbox
and blackbox_transpose
functions in this package for
procedures that accomodate missing data and multidimensionality estimates.
aldmck(data, respondent=0, missing=NULL, polarity, verbose=FALSE)
aldmck(data, respondent=0, missing=NULL, polarity, verbose=FALSE)
data |
matrix of numeric values, containing the perceptual data. Respondents should be organized on rows, and stimuli on columns. It is helpful, though not necessary, to include row names and column names. |
respondent |
integer, specifies the column in the data matrix of the stimuli that contains the respondent's self-placement on the scale. Setting respondent = 0 specifies that the self-placement data is not available. Self-placement data is not required to estimate the locations of the stimuli, but is required if recovery of the respondent ideal points, or distortion parameters is desired. Note that no distortion parameters are estimated in AM without self-placements because they are not needed, see equation (24) in Aldrich and McKelvey (1977) for proof. |
missing |
vector or matrix of numeric values, sets the missing values for the data. NA values are always treated as missing regardless of what is set here. Observations with missing data are discarded before analysis. If input is a vector, then the vector is assumed to contain the missing value codes for all the data. If the input is a matrix, it must be of dimension p x q, where p is the maximum number of missing values and q is the number of columns in the data. Each column of the inputted matrix then specifies the missing data values for the respective variables in data. If null (default), no missing values are in the data other than the standard NA value. |
polarity |
integer, specifies the column in the data matrix of the stimuli that is to be set on the left side (generally this means a liberal) |
verbose |
logical, indicates whether |
An object of class aldmck
.
legislators |
vector, containing the recovered locations of the stimuli. The names of
the stimuli are attached if provided as column names in the argument |
respondents |
matrix, containing the information estimated for each respondent. Observations which were discarded in the estimation for missing data purposes have been NA'd out:
|
eigenvalues |
A vector of the eigenvalues from the estimation. |
AMfit |
Ratio of overall variance to perceptions in scaled data divided by average variance. This measure of fit, described by Aldrich and McKelvey, measures the amount of reduction of the variance of the scaled over unscaled data. |
N |
Number of respondents used in the estimation (i.e. had no missing data) |
N.neg |
Number of cases with negative weights. Only calculated if respondent self-placements are specified, will equal 0 if not. |
N.pos |
Number of cases with positive weights. Only calculated if respondent self-placements are specified, will equal 0 if not. |
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'LC1980', 'summary.aldmck', 'plot.aldmck', 'plot.cdf'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=FALSE) summary(result) plot.aldmck(result)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=FALSE) summary(result) plot.aldmck(result)
blackbox
is a function that takes a matrix of survey data in which individuals
place themselves on continuous scales across multiple issues, and locates those
citizens in a spatial model of voting. Mathematically, this function generalizes
the singular value of a matrix to cases in which there is missing data in the
matrix. Scales generated using perceptual data (i.e. scales of legislator locations
using liberal-conservative rankings by survey respondents) should instead use
the blackbox_transpose
function in this package instead.
blackbox(data, missing=NULL, verbose=FALSE, dims=1, minscale)
blackbox(data, missing=NULL, verbose=FALSE, dims=1, minscale)
data |
matrix of numeric values containing the issue scale data. Respondents should be organized on rows, and stimuli on columns. It is helpful, though not necessary, to include row names and column names. |
missing |
vector or matrix of numeric values, sets the missing values for the data. NA values are always treated as missing regardless of what is set here. Observations with missing data are discarded before analysis. If input is a vector, then the vector is assumed to contain the missing value codes for all the data. If the input is a matrix, it must be of dimension p x q, where p is the maximum number of missing values and q is the number of columns in the data. Each column of the inputted matrix then specifies the missing data values for the respective variables in data. If null (default), no missing values are in the data other than the standard NA value. |
verbose |
logical, indicates whether |
dims |
integer, specifies the number of dimensions to be estimated. |
minscale |
integer, specifies the minimum number of responses a respondent needs needs to provide to be used in the scaling. |
An object of class blackbox
.
stimuli |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
individuals |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Individuals that are discarded from analysis due to the minscale constraint are NA'd out. Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
fits |
A data frame of fit results, with elements listed as follows: |
SSE
Sum of squared errors.
SSE.explained
Explained sum of squared error.
percent
Percentage of total variance explained.
SE
Standard error of the estimate, with formula provided on pg. 973 of the article cited below.
singular
Singluar value for the dimension.
Nrow |
Number of rows/stimuli. |
Ncol |
Number of columns used in estimation. This may differ from the data set due to columns discarded due to the minscale constraint. |
Ndata |
Total number of data entries. |
Nmiss |
Number of missing entries. |
SS_mean |
Sum of squares grand mean. |
dims |
Number of dimensions estimated. |
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'Issues1980', 'summary.blackbox', 'plot.blackbox'.
### Loads issue scales from the 1980 NES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
### Loads issue scales from the 1980 NES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
blackbox_transpose
is a function that takes a matrix of perceptual data, such as
liberal-conservative rankings of various stimuli, and recovers the true
location of those stimuli in a spatial model. It differs from procedures
such as wnominate
, which instead use preference data to estimate
candidate and citizen positions. The procedure here generalizes the technique
developed by John Aldrich and Richard McKelvey in 1977, which is also included
in this package as the aldmck
function.
blackbox_transpose(data, missing=NULL, verbose=FALSE, dims=1, minscale)
blackbox_transpose(data, missing=NULL, verbose=FALSE, dims=1, minscale)
data |
matrix of numeric values, containing the perceptual data. Respondents should be organized on rows, and stimuli on columns. It is helpful, though not necessary, to include row names and column names. |
missing |
vector or matrix of numeric values, sets the missing values for the data. NA values are always treated as missing regardless of what is set here. Observations with missing data are discarded before analysis. If input is a vector, then the vector is assumed to contain the missing value codes for all the data. If the input is a matrix, it must be of dimension p x q, where p is the maximum number of missing values and q is the number of columns in the data. Each column of the inputted matrix then specifies the missing data values for the respective variables in data. If null (default), no missing values are in the data other than the standard NA value. |
verbose |
logical, indicates whether |
dims |
integer, specifies the number of dimensions to be estimated. |
minscale |
integer, specifies the minimum number of responses a respondent needs needs to provide to be used in the scaling. |
An object of class blackbt
.
stimuli |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
individuals |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Individuals that are discarded from analysis due to the minscale constraint are NA'd out. Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
fits |
A data frame of fit results, with elements listed as follows: |
SSE
Sum of squared errors.
SSE.explained
Explained sum of squared error.
percent
Percentage of total variance explained.
SE
Standard error of the estimate, with formula provided in the article cited below.
singular
Singluar value for the dimension.
Nrow |
Number of rows/stimuli. |
Ncol |
Number of columns used in estimation. This may differ from the data set due to columns discarded due to the minscale constraint. |
Ndata |
Total number of data entries. |
Nmiss |
Number of missing entries. |
SS_mean |
Sum of squares grand mean. |
dims |
Number of dimensions estimated. |
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'plotcdf.blackbt', 'LC1980', 'plot.blackbt', 'summary.blackbt', 'LC1980_bbt'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=FALSE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=FALSE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)
boot_aldmck
is a function automates the non-parametric bootstrapping of aldmck
.
The original function takes a matrix of perceptual data, such as liberal-conservative
rankings of various stimuli, and recovers the true location of those stimuli in a spatial
model. The bootstrap simply applies this estimator across multiple resampled data sets
and stores the results of each iteration in a matrix. These results can be used to estimate
uncertainty for various parameters of interest, and can be plotted using the plot.boot_aldmck
function.
boot_aldmck(data, respondent = 0, missing=NULL, polarity, iter=100)
boot_aldmck(data, respondent = 0, missing=NULL, polarity, iter=100)
data |
matrix of numeric values, containing the perceptual data. Respondents should be organized on rows, and stimuli on columns. It is helpful, though not necessary, to include row names and column names. |
respondent |
integer, specifies the column in the data matrix of the stimuli that contains the respondent's self-placement on the scale. Setting respondent = 0 specifies that the self-placement data is not available. Self-placement data is not required to estimate the locations of the stimuli, but is required if recovery of the respondent ideal points, or distortion parameters is desired. Note that no distortion parameters are estimated in AM without self-placements because they are not needed, see equation (24) in Aldrich and McKelvey (1977) for proof. |
missing |
vector or matrix of numeric values, sets the missing values for the data. NA values are always treated as missing regardless of what is set here. Observations with missing data are discarded before analysis. If input is a vector, then the vector is assumed to contain the missing value codes for all the data. If the input is a matrix, it must be of dimension p x q, where p is the maximum number of missing values and q is the number of columns in the data. Each column of the inputted matrix then specifies the missing data values for the respective variables in data. If null (default), no missing values are in the data other than the standard NA value. |
polarity |
integer, specifies the column in the data matrix of the stimuli that is to be set on the left side (generally this means a liberal) |
iter |
integer, is the number of iterations the bootstrap should run for. |
An object of class boot_aldmck
. This is simply a matrix of dimensions iter x number of
stimuli. Each row stores the estimated stimuli locations for each iteration.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'LC1980', 'summary.aldmck', 'plot.aldmck', 'plot.cdf'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- boot_aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), iter=30) plot(result)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- boot_aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), iter=30) plot(result)
boot_blackbt
is a function automates the non-parametric bootstrapping of blackbox_transpose
.
The original function takes a matrix of perceptual data, such as liberal-conservative
rankings of various stimuli, and recovers the true location of those stimuli in a spatial
model. The bootstrap simply applies this estimator across multiple resampled data sets
and stores the results of each iteration in a matrix. These results can be used to estimate
uncertainty for various parameters of interest, and can be plotted using the plot.boot_blackbt
function.
boot_blackbt(data, missing=NULL, dims=1, dim.extract=dims, minscale, iter=100, verbose=FALSE)
boot_blackbt(data, missing=NULL, dims=1, dim.extract=dims, minscale, iter=100, verbose=FALSE)
data |
matrix of numeric values, containing the perceptual data. Respondents should be organized on rows, and stimuli on columns. It is helpful, though not necessary, to include row names and column names. |
missing |
vector or matrix of numeric values, sets the missing values for the data. NA values are always treated as missing regardless of what is set here. Observations with missing data are discarded before analysis. If input is a vector, then the vector is assumed to contain the missing value codes for all the data. If the input is a matrix, it must be of dimension p x q, where p is the maximum number of missing values and q is the number of columns in the data. Each column of the inputted matrix then specifies the missing data values for the respective variables in data. If null (default), no missing values are in the data other than the standard NA value. |
dims |
integer, specifies the number of dimensions to be estimated. |
dim.extract |
integer, specifies which dimension to extract results for the bootstrap from. |
minscale |
integer, specifies the minimum number of responses a respondent needs needs to provide to be used in the scaling. |
iter |
integer, number of iterations the bootstrap should run for. |
verbose |
logical, indicates whether the progress of |
An object of class boot_blackbt
. This is simply a matrix of dimensions iter x number of
stimuli. Each row stores the estimated stimuli locations for each iteration.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox_transpose', 'plot.boot_blackbt'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements bootbbt <- boot_blackbt(LCdat, missing=c(0,8,9), dims=1, minscale=8, iter=10, verbose=FALSE) ### 'LC1980_bbt' can be retrieved quickly with: data(bootbbt) plot.boot_blackbt(bootbbt)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements bootbbt <- boot_blackbt(LCdat, missing=c(0,8,9), dims=1, minscale=8, iter=10, verbose=FALSE) ### 'LC1980_bbt' can be retrieved quickly with: data(bootbbt) plot.boot_blackbt(bootbbt)
Output from 10 bootstrap trials of LC1980 data. Included to allow the example to run sufficiently quickly to pass CRAN guidelines.
data(bootbbt)
data(bootbbt)
See 'boot_blackbt'.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'LC1980', 'boot_blackbt', 'plot.boot_blackbt'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements bootbbt <- boot_blackbt(LCdat, missing=c(0,8,9), dims=1, minscale=8, iter=10) ### 'LC1980_bbt' can be retrieved quickly with: data(bootbbt) plot.boot_blackbt(bootbbt)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements bootbbt <- boot_blackbt(LCdat, missing=c(0,8,9), dims=1, minscale=8, iter=10) ### 'LC1980_bbt' can be retrieved quickly with: data(bootbbt) plot.boot_blackbt(bootbbt)
Liberal-Conservative 10-point scales from the University of Salamanca's Parliamentary Elites of Latin America (PELA) survey. Stored as a matrix of integers. The number 99 is a missing value. These data come from Sebastian Saiegh and are used in the paper and book cited below.
data(colombia)
data(colombia)
The data is formatted as an integer matrix with the following elements.
colombia |
matrix, containing reported placements of various stimuli on a 10 point Liberal-Conservative scale:
|
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
Sebastian Saiegh. 2009. “Recovering a Basic Space from Elite Surveys: Evidence from Latin America.” Legislative Studies Quarterly 34(1): 117-145. doi: 10.3162/036298009787500349
Sebastian Saiegh. 2011. Ruling By Statute: How Uncertainty and Vote-Buying Shape Lawmaking. New York: Cambridge University Press. doi: 10.1017/CBO9780511842276
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'summary.aldmck', 'plot.aldmck', 'plot.cdf'.
### Loads the Liberal-Conservative scales from the 2004 PELA survey. data(colombia) tmp <- colombia[,c(5:8,12:17)] result <- aldmck(data=tmp, polarity=7, respondent=10, missing=c(99), verbose=TRUE) summary(result) plot.cdf(result)
### Loads the Liberal-Conservative scales from the 2004 PELA survey. data(colombia) tmp <- colombia[,c(5:8,12:17)] result <- aldmck(data=tmp, polarity=7, respondent=10, missing=c(99), verbose=TRUE) summary(result) plot.cdf(result)
fit
is a convenience function to extract the model fit statistics from an aldmck
, blackbox
, or blackbt
object.
fit(object)
fit(object)
object |
an |
The model fit statistics of the estimated output, which can also be recovered as
object$fits
(for blackbox
or blackbt
objects) or
object$AMfit
(for aldmck
objects). Please refer to the
documentation of aldmck
, blackbox
, or blackbox_transpose
for specifics.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'blackbox', 'blackbox_transpose'.
### Loads issue scales from the 1980 NES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) fit(Issues1980_bb)
### Loads issue scales from the 1980 NES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) fit(Issues1980_bb)
individuals
is a convenience function to extract the individual/respondent parameters from an aldmck
, blackbox
, or blackbt
object.
individuals(object)
individuals(object)
object |
an |
The individual parameters of the estimated output, which can also be recovered as
object$individuals
(for blackbox
or blackbt
objects) or
object$respondents
(for aldmck
objects). Please refer to the
documentation of aldmck
, blackbox
, or blackbox_transpose
for specifics.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'blackbox', 'blackbox_transpose'.
### Loads issue scales from the 1980 NES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) individuals(Issues1980_bb)
### Loads issue scales from the 1980 NES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) individuals(Issues1980_bb)
Issue scales from the 1980 National Election Study. The numbers 0, 8, and 9 are considered to be missing values, except for the two abortion scales, where '7' is also a missing value. Hence, it must be recoded as in the example shown below before scaling. The data is used as an example for blackbox().
data(LC1980)
data(LC1980)
The data is formatted as an numeric matrix with the following elements.
Issues |
matrix, containing reported self-placements along various stimuli on a 7 point Liberal-Conservative scales (with the exception of abortion scales, which are 4 point):
|
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
American National Election Studies (https://electionstudies.org/)
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox', 'summary.blackbox'.
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
Blackbox estimates from issues scales from the 1980 American National Election Study.
data(Issues1980_bb)
data(Issues1980_bb)
An object of class blackbox
.
stimuli |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
individuals |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Individuals that are discarded from analysis due to the minscale constraint are NA'd out. Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
fits |
A data frame of fit results, with elements listed as follows: |
SSE
Sum of squared errors.
SSE.explained
Explained sum of squared error.
percent
Percentage of total variance explained.
SE
Standard error of the estimate, with formula provided on pg. 973 of the article cited below.
singular
Singluar value for the dimension.
Nrow |
Number of rows/stimuli. |
Ncol |
Number of columns used in estimation. This may differ from the data set due to columns discarded due to the minscale constraint. |
Ndata |
Total number of data entries. |
Nmiss |
Number of missing entries. |
SS_mean |
Sum of squares grand mean. |
dims |
Number of dimensions estimated. |
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
American National Election Studies (https://electionstudies.org/)
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'Issues1980', 'summary.blackbox', 'plot.blackbox'.
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
Liberal-Conservative 7-point scales from the 1980 National Election Study. Includes (in order) self-placement, and rankings of Carter, Reagan, Kennedy, Anderson, Republican party, Democratic Party. Stored as a matrix of integers. The numbers 0, 8, and 9 are considered to be missing values.
data(LC1980)
data(LC1980)
The data is formatted as an integer matrix with the following elements.
LC1980 |
matrix, containing reported placements of various stimuli on a 7 point Liberal-Conservative scale:
|
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
American National Election Studies (https://electionstudies.org/)
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'summary.aldmck', 'plot.aldmck', 'plot.cdf'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot(result)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot(result)
Blackbox-Transpose estimates from Liberal-Conservative 7-point scales from the 1980 National Election Study. Estimates in 3 dimensions.
data(LC1980_bbt)
data(LC1980_bbt)
An object of class blackbt
.
stimuli |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
individuals |
vector of data frames of length dims. Each data frame presents results for estimates from that dimension (i.e. x$stimuli[[2]] presents results for dimension 2). Individuals that are discarded from analysis due to the minscale constraint are NA'd out. Each row contains data on a separate stimulus, and each data frame includes the following variables:
|
fits |
A data frame of fit results, with elements listed as follows: |
SSE
Sum of squared errors.
SSE.explained
Explained sum of squared error.
percent
Percentage of total variance explained.
SE
Standard error of the estimate, with formula provided in the article cited below.
singular
Singluar value for the dimension.
Nrow |
Number of rows/stimuli. |
Ncol |
Number of columns used in estimation. This may differ from the data set due to columns discarded due to the minscale constraint. |
Ndata |
Total number of data entries. |
Nmiss |
Number of missing entries. |
SS_mean |
Sum of squares grand mean. |
dims |
Number of dimensions estimated. |
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
American National Election Studies (https://electionstudies.org/)
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'plotcdf.blackbt', 'LC1980', 'plot.blackbt', 'summary.blackbt', 'blackbox_transpose'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)
plot.aldmck
reads an aldmck
object and plots the probability distribution
of the respondents and stimuli.
## S3 method for class 'aldmck' plot(x, ...)
## S3 method for class 'aldmck' plot(x, ...)
x |
an |
... |
Other arguments to |
A plot of the probability distribution of the respondent ideal points, along with the locations of the stimuli. If no self-placements were specified during estimation, no graphical plots will appear.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'LC1980', 'summary.aldmck', 'plot.AM', 'plot.cdf' 'plot.aldmck_negative','plot.aldmck_positive'.
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot(result)
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot(result)
plot.aldmck_negative
reads an aldmck
object and plots the probability distribution
of the respondents and stimuli with negative weights.
## S3 method for class 'aldmck_negative' plot(x, xlim=c(-2,2), ...)
## S3 method for class 'aldmck_negative' plot(x, xlim=c(-2,2), ...)
x |
an |
xlim |
vector of length 2, fed to the |
... |
other arguments to |
A plot of the probability distribution of the respondent ideal points, along with the locations of the stimuli. If no negative weights exist, either because respondent self-placements are not specified, or because all weights are positive, a plot indicating this in text is given.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'LC1980', 'summary.aldmck', 'plot.cdf', 'plot.aldmck'
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.aldmck_negative(result, xlim=c(-1.5,1.5))
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.aldmck_negative(result, xlim=c(-1.5,1.5))
plot.aldmck_positive
reads an aldmck
object and plots the probability distribution
of the respondents and stimuli with positive weights.
## S3 method for class 'aldmck_positive' plot(x, xlim=c(-2,2), ...)
## S3 method for class 'aldmck_positive' plot(x, xlim=c(-2,2), ...)
x |
an |
xlim |
vector of length 2, fed to the |
... |
other arguments to |
A plot of the probability distribution of the respondent ideal points, along with the locations of the stimuli. If no weights exist because respondent self-placements are not specified, a plot indicating this in text is given.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'LC1980', 'summary.aldmck', 'plot.cdf', 'plot.aldmck'
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.aldmck_positive(result,xlim=c(-1.5,1.5))
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.aldmck_positive(result,xlim=c(-1.5,1.5))
plot.AM
reads an aldmck
object and plots the probability distribution
of the respondents and stimuli.
## S3 method for class 'AM' plot(x, xlim=c(-2,2), ...)
## S3 method for class 'AM' plot(x, xlim=c(-2,2), ...)
x |
an |
xlim |
vector of length 2, fed to the |
... |
other arguments to |
A plot of the probability distribution of the respondent ideal points, along with the locations of the stimuli. If no self-placements were specified during estimation, no graphical plots will appear.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'LC1980', 'summary.aldmck', 'plot.cdf', 'plot.aldmck'
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.AM(result, xlim=c(-1.5,1.5))
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.AM(result, xlim=c(-1.5,1.5))
plot.blackbox
reads an blackbox
object and plots a histogram of the estimated intercepts.
## S3 method for class 'blackbox' plot(x, ...)
## S3 method for class 'blackbox' plot(x, ...)
x |
an |
... |
other arguments to |
A histogram of the estimated intercepts.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'Issues1980', 'summary.blackbox', 'plot.blackbox'.
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb) plot(Issues1980_bb)
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb) plot(Issues1980_bb)
plot.blackbt
reads an blackbt
object and plots the probability distribution
of the respondents and stimuli.
## S3 method for class 'blackbt' plot(x, xlim=c(-1,1), ...)
## S3 method for class 'blackbt' plot(x, xlim=c(-1,1), ...)
x |
an |
xlim |
vector of length 2, fed to the |
... |
other arguments to |
A plot of the probability distribution of the respondent ideal points, along with the locations of the stimuli.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox_transpose', 'LC1980', 'plotcdf.blackbt', 'summary.blackbt', 'LC1980_bbt'.
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)
### Loads and scales the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)
plot.boot_aldmck
reads an boot_aldmck
object and plots a dotchart of the stimuli with estimated confidence intervals.
## S3 method for class 'boot_aldmck' plot(x, ...)
## S3 method for class 'boot_aldmck' plot(x, ...)
x |
an |
... |
other arguments to |
A dotchart of estimated stimulus locations, with 95 percent confidence intervals. Point estimates are estimates from the original data set.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'boot_aldmck'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- boot_aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), iter=30) plot(result)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- boot_aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), iter=30) plot(result)
plot.boot_blackbt
reads an boot_blackbt
object and plots a dotchart of the stimuli with estimated confidence intervals.
## S3 method for class 'boot_blackbt' plot(x, ...)
## S3 method for class 'boot_blackbt' plot(x, ...)
x |
an |
... |
other arguments to |
A dotchart of estimated stimulus locations, with 95 percent confidence intervals. Point estimates are estimates from the original data set.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox_transpose', 'boot_blackbt'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) data <- LC1980[,-1] #Dump the column of self-placements bootbbt <- boot_blackbt(data, missing=c(0,8,9), dims=1, minscale=8, iter=10) ### 'bootbbt' can be retrieved quickly with: data(bootbbt) plot.boot_blackbt(bootbbt)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) data <- LC1980[,-1] #Dump the column of self-placements bootbbt <- boot_blackbt(data, missing=c(0,8,9), dims=1, minscale=8, iter=10) ### 'bootbbt' can be retrieved quickly with: data(bootbbt) plot.boot_blackbt(bootbbt)
plot.aldmck
reads an aldmck
object and plots the cumulative distribution
of the respondents and stimuli.
## S3 method for class 'cdf' plot(x, align=NULL, xlim=c(-2,2), ...)
## S3 method for class 'cdf' plot(x, align=NULL, xlim=c(-2,2), ...)
x |
an |
align |
integer, the x-axis location that stimuli names should be aligned to If set to NULL, it will attempt to guess a location. |
xlim |
vector of length 2, fed to the |
... |
other arguments to |
A plot of the empirical cumulative distribution of the respondent ideal points, along with the locations of the stimuli. If no self-placements were specified during estimation, no graphical plots will appear.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'LC1980', 'summary.aldmck', 'plot.aldmck'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.cdf(result)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.cdf(result)
plotcdf.blackbt
reads an blackbt
object and plots the cumulative distribution
of the respondents and stimuli.
plotcdf.blackbt(x, align=NULL, xlim=c(-1.2,1), ...)
plotcdf.blackbt(x, align=NULL, xlim=c(-1.2,1), ...)
x |
an |
align |
integer, the x-axis location that stimuli names should be aligned to If set to NULL, it will attempt to guess a location. |
xlim |
vector of length 2, fed to the |
... |
other arguments to |
A plot of the empirical cumulative distribution of the respondent ideal points, along with the locations of the stimuli.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox_transpose', 'LC1980', 'plot.blackbt', 'summary.blackbt', 'LC1980_bbt'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plotcdf.blackbt(LC1980_bbt)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plotcdf.blackbt(LC1980_bbt)
predict.aldmck
reads an aldmck
object and uses the estimates to generate a matrix of predicted values.
## S3 method for class 'aldmck' predict(object, caliper=0.2, ...)
## S3 method for class 'aldmck' predict(object, caliper=0.2, ...)
object |
A |
caliper |
Caliper tolerance. Any individuals with estimated weights lower than this value are NA'd out for prediction. Since predictions are made by dividing observed values by estimating weights, very small weights will grossly inflate the magnitude of predicted values and lead to extreme predictions. |
... |
Ignored. |
A matrix of predicted values generated from the parameters estimated from a aldmck
object.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) ### Estimate an aldmck object from example and call predict function result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) prediction <- predict.aldmck(result) ### Examine predicted vs. observed values for first 10 respondents ### Note some observations are NA'd in prediction matrix from caliper ### First column of LC1980 are self-placements, which are excluded LC1980[1:10,-1] prediction[1:10,] ### Check correlation across all predicted vs. observed, excluding missing values prediction[which(LC1980[,-1] %in% c(0,8,9))] <- NA cor(as.numeric(prediction), as.numeric(LC1980[,-1]), use="pairwise.complete")
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) ### Estimate an aldmck object from example and call predict function result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) prediction <- predict.aldmck(result) ### Examine predicted vs. observed values for first 10 respondents ### Note some observations are NA'd in prediction matrix from caliper ### First column of LC1980 are self-placements, which are excluded LC1980[1:10,-1] prediction[1:10,] ### Check correlation across all predicted vs. observed, excluding missing values prediction[which(LC1980[,-1] %in% c(0,8,9))] <- NA cor(as.numeric(prediction), as.numeric(LC1980[,-1]), use="pairwise.complete")
predict.blackbox
reads an blackbox
object and uses the estimates to generate a matrix of predicted values.
## S3 method for class 'blackbox' predict(object, dims=1, ...)
## S3 method for class 'blackbox' predict(object, dims=1, ...)
object |
A |
dims |
Number of dimensions used in prediction. Must be equal to or less than number of dimensions used in estimation. |
... |
Ignored. |
A matrix of predicted values generated from the parameters estimated from a blackbox
object.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox', 'Issues1980'
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode ### Estimate blackbox object from example and call predict function Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) prediction <- predict.blackbox(Issues1980_bb, dims=3) ### Examine predicted vs. observed values for first 10 respondents ### Note that 4th and 6th respondents are NA because of missing data Issues1980[1:10,] prediction[1:10,] ### Check correlation across all predicted vs. observed, excluding missing values prediction[which(Issues1980 %in% c(0,8,9))] <- NA cor(as.numeric(prediction), as.numeric(Issues1980), use="pairwise.complete")
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode ### Estimate blackbox object from example and call predict function Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) prediction <- predict.blackbox(Issues1980_bb, dims=3) ### Examine predicted vs. observed values for first 10 respondents ### Note that 4th and 6th respondents are NA because of missing data Issues1980[1:10,] prediction[1:10,] ### Check correlation across all predicted vs. observed, excluding missing values prediction[which(Issues1980 %in% c(0,8,9))] <- NA cor(as.numeric(prediction), as.numeric(Issues1980), use="pairwise.complete")
predict.blackbt
reads an blackbt
object and uses the estimates to generate a matrix of predicted values.
## S3 method for class 'blackbt' predict(object, dims=1, ...)
## S3 method for class 'blackbt' predict(object, dims=1, ...)
object |
A |
dims |
Number of dimensions used in prediction. Must be equal to or less than number of dimensions used in estimation. |
... |
Ignored. |
A matrix of predicted values generated from the parameters estimated from a blackbt
object.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox_transpose', 'LC1980', 'LC1980_bbt'
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements ### Estimate blackbt object from example and call predict function LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) prediction <- predict.blackbt(LC1980_bbt, dims=2) ### Examine predicted vs. observed values for first 10 respondents ### First column of LC1980 are self-placements, which are excluded LC1980[1:10,-1] prediction[1:10,] ### Check correlation across all predicted vs. observed, excluding missing values prediction[which(LC1980[,-1] %in% c(0,8,9))] <- NA cor(as.numeric(prediction), as.numeric(LC1980[,-1]), use="pairwise.complete")
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] #Dump the column of self-placements ### Estimate blackbt object from example and call predict function LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) prediction <- predict.blackbt(LC1980_bbt, dims=2) ### Examine predicted vs. observed values for first 10 respondents ### First column of LC1980 are self-placements, which are excluded LC1980[1:10,-1] prediction[1:10,] ### Check correlation across all predicted vs. observed, excluding missing values prediction[which(LC1980[,-1] %in% c(0,8,9))] <- NA cor(as.numeric(prediction), as.numeric(LC1980[,-1]), use="pairwise.complete")
stimuli
is a convenience function to extract the stimulus parameters from an aldmck
, blackbox
, or blackbt
object.
stimuli(object)
stimuli(object)
object |
an |
The stimuli of the estimated output, which can also be recovered as object\$stimuli
.
Please refer to the documentation of aldmck
, blackbox
, or blackbox_transpose
for specifics.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'blackbox', 'blackbox_transpose'.
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb) stimuli(Issues1980_bb)
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb) stimuli(Issues1980_bb)
summary.aldmck
reads an aldmck
object and prints a summary.
## S3 method for class 'aldmck' summary(object, ...)
## S3 method for class 'aldmck' summary(object, ...)
object |
an |
... |
further arguments to |
A summary of an aldmck
object. Reports number of stimuli, respondents
scaled, number of respondents with positive and negative weights, R-squared,
Reudction of normalized variance of perceptions, and stimuli locations.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
John H. Aldrich and Richard D. McKelvey. 1977. “A Method of Scaling with Applications to the 1968 and 1972 Presidential Elections.” American Political Science Review 71(1): 111-130. doi: 10.2307/1956957
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Thomas R. Palfrey and Keith T. Poole. 1987. “The Relationship between Information, Ideology, and Voting Behavior.” American Journal of Political Science 31(3): 511-530. doi: 10.2307/2111281
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'aldmck', 'LC1980', 'plot.aldmck', 'plot.cdf'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.aldmck(result)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) result <- aldmck(data=LC1980, polarity=2, respondent=1, missing=c(0,8,9), verbose=TRUE) summary(result) plot.aldmck(result)
summary.blackbox
reads an blackbox
object and prints a summary.
## S3 method for class 'blackbox' summary(object, ...)
## S3 method for class 'blackbox' summary(object, ...)
object |
a |
... |
further arguments to |
A summary of a blackbox
object. For each dimension, reports all
stimuli with coordinates, individuals used for scaling, and fit. Also
summarizes number of rows, columns, total data entries, number of missing
entries, percent missing data, and sum of squares.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox', 'Issues1980'
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
### Loads issue scales from the 1980 ANES. data(Issues1980) Issues1980[Issues1980[,"abortion1"]==7,"abortion1"] <- 8 #missing recode Issues1980[Issues1980[,"abortion2"]==7,"abortion2"] <- 8 #missing recode Issues1980_bb <- blackbox(Issues1980, missing=c(0,8,9), verbose=FALSE, dims=3, minscale=8) ### 'Issues1980_bb' can be retrieved quickly with: data(Issues1980_bb) summary(Issues1980_bb)
summary.blackbt
reads an blackbt
object and prints a summary.
## S3 method for class 'blackbt' summary(object, ...)
## S3 method for class 'blackbt' summary(object, ...)
object |
a |
... |
further arguments to |
A summary of a blackbt
object. For each dimension, reports all
stimuli with coordinates, individuals used for scaling, and fit. Also
summarizes number of rows, columns, total data entries, number of missing
entries, percent missing data, and sum of squares.
Keith Poole [email protected]
Howard Rosenthal [email protected]
Jeffrey Lewis [email protected]
James Lo [email protected]
Royce Carroll [email protected]
Christopher Hare [email protected]
David A. Armstrong II, Ryan Bakker, Royce Carroll, Christopher Hare, Keith T. Poole, and Howard Rosenthal. 2021. Analyzing Spatial Models of Choice and Judgment. 2nd ed. Statistics in the Social and Behavioral Sciences Series. Boca Raton, FL: Chapman & Hall/CRC. doi: 10.1201/9781315197609
Keith T. Poole, Jeffrey B. Lewis, Howard Rosenthal, James Lo, and Royce Carroll. 2016. “Recovering a Basic Space from Issue Scales in R.” Journal of Statistical Software 69(7): 1-21. doi:10.18637/jss.v069.i07
Keith T. Poole. 1998. “Recovering a Basic Space From a Set of Issue Scales.” American Journal of Political Science 42(3): 954-993. doi: 10.2307/2991737
'blackbox_transpose', 'LC1980', 'plot.blackbt', 'plotcdf.blackbt', 'LC1980_bbt'.
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] # Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)
### Loads the Liberal-Conservative scales from the 1980 ANES. data(LC1980) LCdat <- LC1980[,-1] # Dump the column of self-placements LC1980_bbt <- blackbox_transpose(LCdat, missing=c(0,8,9), dims=3, minscale=5, verbose=TRUE) ### 'LC1980_bbt' can be retrieved quickly with: data(LC1980_bbt) summary(LC1980_bbt) plot(LC1980_bbt)