Intro to Conjoint Experiments | Exercise - 5
1 Environment preparation
# ### Data import ###
# install.packages("readr") # read datasets
# install.packages("qualtRics") # read qualtrics datasets
# ### Data manipulation ###
# install.packages("dplyr") # pipes and data manipulation
# ### Visualization ###
# install.packages("ggplot2") # graphing capabilities
# ### Estimation ###
# install.packages("cjoint") # base amce package
# install.packages("cregg") # amce and mm
# install.packages("factorEx") # amce with non-uniform distribution
## Custom build functions
# library(devtools)
# install_github("albertostefanelli/cjoint") # fixes some problem with cjoint
### Data import ###
library("readr")
library("qualtRics")
### Data manipulation ###
library("dplyr")
### Visualization ###
library("ggplot2")
### Estimation ###
library("cjoint")
library("cregg")
library("factorEx")
2 Data
- From the paper “The Ties that Double Bind” (Teele, Kalla, and Rosenbluth 2018)
- We are going to use the Legislators and Voters sample
- The authors want to test different type of gender biases
- Among Legislators
- Among Voters
Attribute | Values |
---|---|
Gender | Female, Male |
Age | 29, 45, 65 |
Number of Children | 0, 1, 3 |
Highest Elected Political Post | None, 1, 3, 8 |
Occupation | Corporate Lawyer, Mayor, State Legislator, Third Grade Teacher |
Spouse’s Occupation | Doctor, Farmer, Unmarried |
- Variables in the dataset
- CJ choice task= “winner”
- Type of sample = “sample”
- Respondent’s gender=“female_respondent”
- Respondent’s PID= “democrat_respondent”, “republican_respondent”
- Candidate’s gender= “orig_cand_female”
- Candidate’s political Experience= “orig_0ys”, “orig_1ys”, “orig_3ys”, “orig_8ys”
- Candidate’s number of Children= “orig_0ch”, “orig_1ch”, “orig_3ch”
- Candidate’s political Post= “orig_may”, “orig_leg”
- Candidate’s occupation= “orig_law”, “orig_leg”, “orig_may”, “orig_teach”
- Candidate’s spouse’s Occupation= “orig_UN_sp”, “orig_FM_sp”, “orig_MD_sp”
- Candidate’s candidate’s Age= “orig_29”, “orig_45”, orig_65”
- CJ choice task= “winner”
3 Task
- Attributes’ interactions
- Postulate Hypothesises/Expectation about attributes interactions
- Test your hypothesises
- Estimate the least-liked profile
- Sub-group analysis
- Postulate Hypothesises/Expectation about subgroups
- Test your hypothesises
- Estimate the least-liked profile
- Estimate a model with a non-uniform marginal distribution (data taken from legislatoR)
- Gender .4, .6
- Experience .2, .30, .3, .2
- Children .33, .33, .33
- Occupation .10, .60, .20, .10
- Spouse’s Occupation .33, .33, .33
- Age .20, .55, .25
- Try replicate the sub-group analysis using a mixture model [OPTIONAL]
- Include a concomitant variable (respondent-varying) in the estimation of the mixture components
# load the data
<- readr::read_csv("https://github.com/albertostefanelli/conjoint_class/raw/master/data/teele.csv") teele_data
References
Teele, Dawn Langan, Joshua Kalla, and Frances Rosenbluth. 2018. “The Ties That Double Bind: Social Roles and Women’s Underrepresentation in Politics.” American Political Science Review 112 (3): 525–41. https://doi.org/gdwd55.