How to evaluate all possible contrasts of an interaction effect Let's say I have an experiment where I pair people up with either individuals of the same political orientation, or different.  I track before and after measures of a respondent's belief in global warming.  
Consider the following specification:
fit <- lm_robust(
  belief_global_warming  ~ politics + partner_politics + partner_politics + politics * partner_politics + sex,
  data = data,
  clusters = team_id,
  se = "stata"
)

Let's say the output for the coefficients of interest look like so:
                                               Estimate Std. Error t value Pr(>|t|) CI Lower CI Upper  DF
politicsRepublican                              6.3265     2.6573  2.3808  0.01893   1.0625  11.5905 114
partner_politicsRepublican                      1.2334     1.5024  0.8210  0.41338  -1.7428   4.2096 114
politicsRepublican:partner_politicsRepublican  -6.5873     2.9706 -2.2175  0.02857 -12.4720  -0.7026 114

So, the reference group auto-selected by R is Democrats paired with Democrats.  I want to be able to say that a D paired with an R has different response in the DV than any of the other combinations (RD, RR, DD). 
What is the appropriate way to do the following:
(1) Compare mixed groups (Republican paired with Democrat or Democrat paired with Republican) against all other groupings to detect if before and after changes are significant relative to all reference groups, while also controlling for multiple tests. 
My thought was to just set a different reference group and run all the possible combinations, but I remembered Stata's contrast command, and wonder if there's a parsimonious R equivalent.
(2) Is putting the DV as a before-and-after change the appropriate method? I have heard a suggestion about keeping the DV a level and have before and after dummies (like a D-I-D approach), but I'm not sure I understand it. 
 A: I have never used the lm_robust function before, but I would suggest a logistic regression model for this study, which you can do with the glm() function. It would allow you to compare mixed groups to both types of non-mixed groups (question 1) and allow you to analyze the predictors of changing beliefs (question 2).
Set up your data in an $n by 5$ data frame with variables $Pair=\left\{1,...,n\right\}$, $Type 1=\left\{0,1\right\}$, $Type 2=\left\{0,1\right\}$, and $Change=\left\{0,1\right\}$, where $Pair$ is an identifying variable, $Type 1$ describes if they were in a Republican/Republican group, $Type 2$ describes if they were in a Democrat/Democrat groups, and $Change$ describes whether their beliefs changed. For example:
Pair     Type 1     Type 2     Change
1        0          0          1
2        0          1          0
3        1          0          1 
4        1          0          0
.        .          .          .
.        .          .          .
.        .          .          .

This would make mixed groups your reference group, such that for mixed groups $Type1=0$ and $Type2=0$.
Now, use R to do a logistic regression and analyze it:
mod=glm(Change~Type1+Type2,family='binomial')
summary(mod)
confint(mod)
exp(coef(mod))/(1+exp(coef(mod)))

This creates model, summarizes it, gives confidence intervals, and gives odds ratios. The odds ratios are one way to answer both your questions. Probabilities are also another way to answer both your questions.The probability of changing beliefs is given by
$$\pi(change=1)=\frac{exp(\beta_0+\beta_1*Type1+\beta_2*Type2)}{1+exp(\beta_0+\beta_1*Type1+\beta_2*Type2)}$$
Thus, for mixed groups, the probability of change is
$$\pi(change=1|Type=Mixed)=\frac{exp(\beta_0+\beta_1*0+\beta_2*0)}{1+exp(\beta_0+\beta_1*0+\beta_2*0)}=\frac{exp(\beta_0)}{1+exp(\beta_0)}$$
and the probability of change for a Republican/Republican group is
$$\pi(change=1|Type=RR)=\frac{exp(\beta_0+\beta_1*1+\beta_2*0)}{1+exp(\beta_0+\beta_1*1+\beta_2*0)}=\frac{exp(\beta_0+\beta_1)}{1+exp(\beta_0+\beta_1)}$$
and the probability of change for a Democrat/Democrat group is
$$\pi(change=1|Type=DD)=\frac{exp(\beta_0+\beta_1*0+\beta_2*1)}{1+exp(\beta_0+\beta_1*0+\beta_2*1)}=\frac{exp(\beta_0+\beta_2)}{1+exp(\beta_0+\beta_2)}$$
