endorse.plot {endorse} | R Documentation |
Descriptive Plot of Endorsement Experiment Data
Description
This function creates a descriptive plot for a question in an endorsement experiment.
Usage
endorse.plot(Y, data, scale, dk = 98, ra = 99, yaxis = NULL,
col.seq = NA)
Arguments
Y |
a character vector. List of the variable names for the responses to a question. Each variable name corresponds to each treatment status. |
data |
data frame containing the variables. |
scale |
an integer. The scale of the responses. The function
assumes that the responses are coded so that |
dk |
an integer indicating the value of the response variable
that is to be interpreted as “Don't Know.” Default is |
ra |
an integer indicating the value of the response variable
that is to be interpreted as “Refused.” Default is |
yaxis |
a character vector of the same length as |
col.seq |
a vector of colors for the bars or bar components. By default, a gradation of gray where the darkest indicates the highest support level. |
Value
A descriptive plot for the responses to a question.
Author(s)
Yuki Shiraito, Department of Political Science, University of Michigan shiraito@umich.edu.
Kosuke Imai, Department of Government and Statistics, Harvard University Imai@Harvard.Edu, https://imai.fas.harvard.edu/
Examples
data(pakistan)
Y <- c("Polio.a", "Polio.b", "Polio.c", "Polio.d", "Polio.e")
yaxis <- c("Control", "Kashmir", "Afghan", "Al-Qaida", "Tanzeems")
endorse.plot(Y = Y, data = pakistan, scale = 5)