First we convert from 2x2 into a 4x1 by making the interaction into its own variable. Next we make the contrast matrix, and perform a one-tailed t-test. Rinse repeat for every measure of interest.
TL;DR is that basically all of our measures are really significant.
with_men$interact <- interaction(with_men$condition, with_men$gender)
levels(with_men$interact)
## [1] "non.female" "stereo.female" "non.male" "stereo.male"
aovResult <- aov(enroll_intent_all ~ interact, data=with_men) #one-way ANOVA with new feature
contrastMat <- rbind("contr 03"=c(1,-3,1,1)) #coef for interaction
summary(glht(aovResult, linfct=mcp(interact=contrastMat), alternative="greater"), test=adjusted("none"))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: User-defined Contrasts
##
##
## Fit: aov(formula = enroll_intent_all ~ interact, data = with_men)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(>t)
## contr 03 <= 0 2.9179 0.9233 3.16 0.00102 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- none method)
# CONTRAST ANALYSIS FOR AMBIENT BELONGING
aovResult <- aov(am_be_all ~ interact, data=with_men) #one-way ANOVA with new feature
contrastMat <- rbind("contr 03"=c(1,-3,1,1)) #coef for interaction
summary(glht(aovResult, linfct=mcp(interact=contrastMat), alternative="greater"), test=adjusted("none"))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: User-defined Contrasts
##
##
## Fit: aov(formula = am_be_all ~ interact, data = with_men)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(>t)
## contr 03 <= 0 3.147 0.921 3.417 0.000447 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- none method)
# CONTRAST ANALYSIS FOR FUTURE INTENTIONS
aovResult <- aov(long_term_all ~ interact, data=with_men) #one-way ANOVA with new feature
contrastMat <- rbind("contr 03"=c(1,-3,1,1)) #coef for interaction
summary(glht(aovResult, linfct=mcp(interact=contrastMat), alternative="greater"), test=adjusted("none"))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: User-defined Contrasts
##
##
## Fit: aov(formula = long_term_all ~ interact, data = with_men)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(>t)
## contr 03 <= 0 3.451 1.046 3.299 0.000658 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- none method)
# CONTRAST ANALYSIS FOR GENDER ANXIETY
aovResult <- aov(gender_anxi_all ~ interact, data=with_men) #one-way ANOVA with new feature
contrastMat <- rbind("contr 03"=c(1,-3,1,1)) #coef for interaction
summary(glht(aovResult, linfct=mcp(interact=contrastMat), alternative="less"), test=adjusted("none"))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: User-defined Contrasts
##
##
## Fit: aov(formula = gender_anxi_all ~ interact, data = with_men)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(<t)
## contr 03 >= 0 -4.626 1.015 -4.559 6.81e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- none method)
# CONTRAST ANALYSIS FOR GENDER WEB PERCEPTION
aovResult <- aov(gender_web_all ~ interact, data=with_men) #one-way ANOVA with new feature
contrastMat <- rbind("contr 03"=c(1,-3,1,1)) #coef for interaction
summary(glht(aovResult, linfct=mcp(interact=contrastMat), alternative="less"), test=adjusted("none"))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: User-defined Contrasts
##
##
## Fit: aov(formula = gender_web_all ~ interact, data = with_men)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(<t)
## contr 03 >= 0 -2.1070 0.5275 -3.994 5.94e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- none method)
# CONTRAST ANALYSIS FOR SELF CONFIDENCE
aovResult <- aov(self_conf_all ~ interact, data=with_men) #one-way ANOVA with new feature
contrastMat <- rbind("contr 03"=c(1,-3,1,1)) #coef for interaction
summary(glht(aovResult, linfct=mcp(interact=contrastMat), alternative="greater"), test=adjusted("none"))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Multiple Comparisons of Means: User-defined Contrasts
##
##
## Fit: aov(formula = self_conf_all ~ interact, data = with_men)
##
## Linear Hypotheses:
## Estimate Std. Error t value Pr(>t)
## contr 03 <= 0 3.0337 0.9701 3.127 0.00113 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- none method)
# Contrasts Manual to Verify the Above Code (ps. it also checks out with my calculations by hand)
P <- 2 # number of levels factor a
Q <- 2 # number of levels factor b
Njk <- table(with_men$interact) # cell sizes
Mjk <- tapply(with_men$enroll_intent_all, with_men$interact, mean) # cell means
dfSSE <- sum(Njk) - P*Q # degrees of freedom error SS
SSE <- sum((with_men$enroll_intent_all - ave(with_men$enroll_intent_all, with_men$interact, FUN=mean))^2) # error SS
MSE <- SSE / dfSSE # mean error SS
(psiHat <- sum(contrastMat[1, ] * Mjk)) # contrast estimate
## [1] 2.917929
lenSq <- sum(contrastMat[1, ]^2 / Njk) # squared length of contrast
(SE <- sqrt(lenSq*MSE)) # standard error
## [1] 0.9232988
(tStat <- psiHat / SE) # t-statistic
## [1] 3.16033
(pVal <- 2 * (1-pt(abs(tStat), dfSSE))) # p-value (two-sided)
## [1] 0.002044997
# Code taken from https://stats.stackexchange.com/questions/12993/how-to-setup-and-interpret-anova-contrasts-with-the-car-package-in-r