Learn R Programming

cjoint (version 1.0.2)

amce: Estimating Causal Effects in Conjoint Experiments

Description

This function takes a dataset and a conjoint design and returns Average Component-specific Causal Effects (AMCEs) and Average Component Interaction Effects (ACIE) for the attributes specified in the formula. By default, this function assumes uniform randomization of attribute levels and no profile restrictions. If your design incorporates weighted randomization or restrictions on displayable profiles, first generate a design object using makeDesign. Note that interactions with respondent-level characteristics are currently unsupported but are forthcoming in future versions.

Usage

amce(formula, data, design = "uniform", subset = NULL, respondent.id = NULL, 
      cluster = TRUE, na.ignore=FALSE)

Arguments

formula
A formula object specifying the name of the outcome variable on the left-hand side and the attributes for which effects are to be estimated on the right-hand side. RHS attributes should be separated by + signs. Interaction effect
data
A dataframe containing the outcome variable, attributes and respondent covariate data from a conjoint experiment.
design
Either the character string "uniform" or a conjointDesign object created by the makeDesign function. If a conjointDesign is not passed, the function will assume all
subset
A logical vector with length nrow(data) denoting which rows in data should be included in estimation. This can be used to subset the data along respondent-level covariates and estimate separate effects for diferent sub-groups. De
respondent.id
A character string indicating the column of data containing a unique identifier for each respondent. Defaults to NULL.
cluster
A logical indicating whether estimated standard errors should be clustered on respondent.id. Defaults to TRUE.
na.ignore
A logical indicating whether the function should ignore missing rows in data. If FALSE, amce() will raise an error if there are rows with missing values. Defaults to FALSE.

Value

  • An object of class "amce" containing:
  • formulaThe formula passed to the amce() routine
  • estimatesA list containing AMCE and ACIE estimates for each attribute in formula. Each element of estimates corresponds to a single attribute or interaction.
  • attributesA list containing the names
  • baselinesBaseline levels for each attribute in estimates. Baselines determined using the first element of levels(). Use the relevel() function to change the baseline levels for attributes.
  • samplesizeThe number of profiles (rows) in the dataset
  • numrespondentsThe number of respondents in the dataset (if respondent.id is not NULL)

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

summary.amce for summaries and plot.amce for generating a coefficient plot using ggplot2.

makeDesign to create conjointDesign objects.

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)
# Print summary
summary(results)

Run the code above in your browser using DataLab