Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

cjoint (version 1.0.2)

plot.amce: Plot AMCE Estimates

Description

plot method for "amce" objects

Usage

## S3 method for class 'amce':
plot(x, main = "", xlab = "Change in E[Y]", ci = 0.95, 
                    colors = NULL, xlim = NULL, breaks = NULL, 
                    labels = NULL, attribute_names = NULL, level_names = NULL, 
                    label.baseline = TRUE, text.size = 11, text.color = "black", 
                    point.size = 0.6, ...)

Arguments

x
an object of class "amce", a result of a call to amce
main
title of the plot.
xlab
Label of the x-axis of the plot (AMCE or ACIE). Default is "Change in Pr(Y=1)"
ci
Size of confidence intervals to plot around point estimates. Must be between 0 and 1. Default is .95
colors
Vector of color names to be used in the plot. The plot function will alternate between the colors in the vector for each attribute being plotted. If NULL, plot will use a default ggplot2 color scheme.
xlim
Numeric vector denoting the upper and lower bounds of the x-axis in the plot. If NULL the plot function will automatically set a range that includes all effect estimates.
breaks
Numeric vector denoting where x-axis tick marks should be placed. If NULL plot will use ggplot2 defaults
labels
Vector denoting how x-axis tick marks should be labeled. If NULL plot will use ggplot2 defaults
attribute_names
Character vector of attribute names to be plotted as labels. By default plot.amce will use the attribute names in the "amce" object passed to it.
level_names
A list containing character vector elements with names in attribute_names. Each character vector in the list contains the level names to be plotted as labels beneath the corresponding attribute. By default plot.amce will use the
label.baseline
If TRUE, the baseline levels for each attribute will be labeled as such. Defaults to TRUE.
text.size
Size of text. Defaults to 11.
text.color
Color of text in plot. Defaults to "black"
point.size
Size of points in the plot. Defaults to 0.6
...
Other graphical parameters passed to plot

Value

  • A ggplot object containing a dotplot of estimated AMCEs

References

Hainmueller, J., Hopkins, D., and Yamamoto T. (2014) Causal Inference in Conjoint Analysis: Understanding Multi-Dimensional Choices via Stated Preference Experiments. Political Analysis 22(1):1-30

See Also

amce for the main estimation routine.

Examples

Run this code
# Immigration Choice Conjoint Experiment Data from Hainmueller et. al. (2014).
data("immigrationconjoint")
data("immigrationdesign")
  
# Run AMCE estimator using all attributes in the design
results <- amce(Chosen_Immigrant ~  Gender + Education + `Language Skills` + 
                `Country of Origin` + Job + `Job Experience` + `Job Plans` + 
                `Reason for Application` + `Prior Entry`, data=immigrationconjoint, 
                cluster=TRUE, respondent.id="CaseID", design=immigrationdesign)

# Plot results
plot(results, xlab="Change in Pr(Immigrant Preferred for Admission to U.S.)", 
    ylim=c(-.3,.3), breaks=c(-.2, 0, .2), labels=c("-.2","0",".2"), text.size=13)

Run the code above in your browser using DataLab