Learn R Programming

FindIt (version 1.0)

AMIE: Decomposing the Combination Effect into the AMEs and the AMIE.

Description

AMIE shows the decomposition of the average combination effect into the AMEs and the AMIE. The function can decompose the conditional effect by setting the level of one factor equal to its baseline.

Usage

AMIE(object,fac.name,level.name,base.name=NULL,verbose=TRUE,...)

Arguments

object

an object from CausalANOVA.

fac.name

a character 2 dimensional vector indicating two factors of interest.

level.name

a character 2 dimensional vector indicating levels of each factor. When one of level.name is equal to base.name, the function decomposes the conditional effect instead of the combination effect.

base.name

a character 2 dimensional vector indicating baseline levels of each factor. If not specified, the function uses the last level defined by levels().

verbose

whether it prints the results.

...

arguments passed to the function or arguments only for the internal use.

Value

AMIE.main

an estimated AMIE.

baseline

baseline levels in each factor.

decompose

the decomposition of the combination effect into the AMEs and the AMIE. When one of level.name is equal to base.name, the function decomposes the conditional effect.

Details

Suggested workflow.

  1. Specify the order of levels within each factor using levels(). Since the function places penalties on the differences between adjacent levels when levels are ordered, it is crucial to specify the order of levels within each factor carefully.

  2. Run cv.CausalANOVA. Select the cost parameter minimizing the cross-validation error. Or choose largest value of cost such that error is within 1 standard error of the minimum. plot.cv.CausalANOVA can be used to investigate how cross-validation errors vary depending on cost parameters.

  3. Run CausalANOVA. Run the main model with the chosen cost parameter and see summary by summary.CausalANOVA. If researchers want to compute selection probabilities, set select.prob=TRUE. Given it is computationally intensive, we recommend to compute selection probabilities when the model is finalized. The selection probability for the range of the AME (AMIE) is one minus the proportion of bootstrap replicates in which all coefficients for the corresponding factor (factor interaction) are estimated to be zero. The selection probability of the AME (AMIE) is the proportion of bootstrap replicates in which the sign of the effect is the same as the point estimate.

  4. Investigate two-way interactions. Run plot.CausalANOVA and visualize the AMIEs by choosing two factors of interest. Run AMIE to examine decomposition of the average combination effect into the AMIE and AMEs.

References

Post, J. B. and Bondell, H. D. 2013. ``Factor selection and structural identification in the interaction anova model.'' Biometrics 69, 1, 70--79.

Egami, Naoki and Kosuke Imai. 2016+. ``Causal Interaction in Factorial Experiments: Application to Conjoint Analysis.'' Working paper. http://imai.princeton.edu/research/files/int.pdf

See Also

cv.CausalANOVA,CausalANOVA

Examples

Run this code
# NOT RUN {
data(Carlson)
## Specify the order of each factor
Carlson$newRecordF<- factor(Carlson$newRecordF,ordered=TRUE,
                         levels=c("YesLC", "YesDis","YesMP",
                             "noLC","noDis","noMP","noBusi"))
Carlson$promise <- factor(Carlson$promise,ordered=TRUE,levels=c("jobs","clinic","education"))
Carlson$coeth_voting <- factor(Carlson$coeth_voting,ordered=FALSE,levels=c("0","1"))
Carlson$relevantdegree <- factor(Carlson$relevantdegree,ordered=FALSE,levels=c("0","1"))

## Run cv.CausalANOVA
# }
# NOT RUN {
cv.fit <- cv.CausalANOVA(won ~ newRecordF + promise + coeth_voting + relevantdegree,
                         data=Carlson,
                         pair.id=Carlson$contestresp,diff=TRUE, nway=2)

cv.fit
plot(cv.fit)
# }
# NOT RUN {
fit <- CausalANOVA(won ~ newRecordF + promise + coeth_voting + relevantdegree,
                    data=Carlson,
                    pair.id=Carlson$contestresp,diff=TRUE, nway=2,cost=0.15)
## Or when we need selection probabilities.
# }
# NOT RUN {
fit <- CausalANOVA(won ~ newRecordF + promise + coeth_voting + relevantdegree,
                    data=Carlson,
                    pair.id=Carlson$contestresp,diff=TRUE,nway=2,cost=0.15,
                    select.prob=TRUE,boot=500,block.id=Carlson$respcodeS)
# }
# NOT RUN {
summary(fit)

# }
# NOT RUN {
## plot 
plot(fit,fac.name=c("newRecordF","coeth_voting"))
# }
# NOT RUN {
## compute AMIEs
amie1 <- AMIE(fit,fac.name=c("promise","newRecordF"),
              level.name=c("jobs","noLC"),
              base.name=c("jobs","YesLC"))

amie2 <- AMIE(fit,fac.name=c("newRecordF","coeth_voting"),
              level.name=c("noBus","1"),
              base.name=c("noMP","0"))
              
# }

Run the code above in your browser using DataLab