Learn R Programming

cjoint (version 2.0.0)

amce: Estimating Causal Effects in Conjoint Experiments

Description

This function takes a dataset and a conjoint design and returns Average Marginal Component 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. Interactions with respondent-level characteristics are handled by identifying relevant variables as respondent-varying.

Usage

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

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, respondent identifiers, respondent covariate data and sampling weights 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
respondent.varying
A vector giving the names of any respondent-varying characteristics being interacted with AMCEs or ACIEs in the formula.
subset
A logical vector with length nrow(data) denoting which rows in data should be included in estimation. This can for example be used to subset the data along respondent-level covariates. Defaults to NULL.
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.
weights
Formula or vector specifying sampling weights. See documentation for survey package for more information.
baselines
Manually adjust the baselines of select factor variables (either attributes or respondent varying) by supplying a list. Names of list entries should correspond with variable names. The content of each entry should be a character string giving the new base

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 of attributes.
  • baselinesBaseline levels for each attribute in estimates. Baselines determined using the first element of levels(). If a different baseline level is wanted for an attribute, use the relevel() function on the variable prior to calling the amce() routine or supply an alternative baseline in baselines argument.
  • continuousQuantiles for any non-factor variables, whether attributes or respondent varying.
  • respondent.varyingNames of any respondent-varying variables.
  • samplesizeThe number of profiles (rows) in the dataset
  • vcov.coefsThe original unadjusted variance-covariance matrix for raw regression coefficients.
  • vcov.effectsThe modified variance-covariance matrix for causal effects estimates, where dependent relationships have been incorporated into variances and covariances.
  • numrespondentsThe number of respondents in the dataset (if respondent.id is not NULL).
  • dataThe original data matrix.

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)
# Include a respondent-varying interaction
results <- amce(Chosen_Immigrant ~ Gender + Education + Job +
	   	ethnocentrism*Job + Education*Job,
		data=subset(immigrationconjoint, !is.na(immigrationconjoint$ethnocentrism)),
		cluster=TRUE, respondent.id="CaseID",design=immigrationdesign,
		respondent.varying = c("ethnocentrism"))
# Print summary
summary(results)


# Change the baseline for "Education"
baselines <- list()
baselines$Education <- "graduate degree"

results <- amce(Chosen_Immigrant ~ Gender + Education + Job +
		 Education:Job, data=immigrationconjoint,
		 cluster=FALSE,design=immigrationdesign,
		 baselines=baselines)
# Print summary
summary(results)

Run the code above in your browser using DataLab