###################################################
## Conjoint Analysis: Causal Interaction.
###################################################
data(Immigration)
## Not run:
# ## The SVM classifier with a lasso constraint is estimated.
# ## The model includes all three-way and two-way interactions as
# ## well as main effects of five factorial treatments.
#
# ## Run to search for lambdas.
# F.conjoint<- FindIt(model.treat= outcome ~
# Education+Gender+Origin+Experience+Plans,
# nway=3,
# data = Immigration,
# type="binary",
# treat.type="multiple")
#
# ## Make the full factorial design matrix as the target population.
# full <- full.FindIt(F.conjoint)
#
# ## Compute the predicted potential outcomes for the target population.
# Unifdata <- predict(F.conjoint,newdata=full,sort=FALSE)$data
# ## End(Not run)
## load pre-computed F.conjoint and Unifdata
data(F.conjoint)
data(Unifdata)
## Compute AMTEs, ATCEs, and AMTIEs
## Range of each factor interaction.
## The range of the AMTEs for all factors
compare1 <- INT(F.conjoint,target.data=Unifdata,compare=TRUE,order=1)
compare1
## The range of the two-way AMTIEs for all two-way factor interactions
compare2 <- INT(F.conjoint,target.data=Unifdata,compare=TRUE,order=2)
compare2
## Not run:
# ## The range of the three-way AMTIEs for all three-way factor interactions
# compare3 <- INT(F.conjoint,target.data=Unifdata,compare=TRUE,order=3)
# compare3
# ## End(Not run)
## Compute AMTIEs within factor interactions.
## Origin x Experience
out.OP <- INT(F.conjoint,target.data=Unifdata,
column=c("Origin","Experience"),
base=c("India","No.job"), order=2)
out.OP
## Not run:
# ## Education x Gender x Origin
# out.EGO <- INT(F.conjoint,target.data=Unifdata,
# column=c("Education","Gender","Origin"),
# base=c("No.formal","female","India"), order=3)
# out.EGO
# ## End(Not run)
Run the code above in your browser using DataLab