# Simple effects of categorical interaction

I have two two-level categorical variables, IV1 and IV2. I want to fit a linear model in R and find out the simple effect of IV1 on the DV at each level of IV2, separately. I'm not interested in the overall effect of IV1.

Is it correct to sum-code IV1, dummy-code IV2, and fit this model:

lm(DV ~ IV1 * IV2, data=dat)

Then interpret the main effect of IV1 as the effect of IV1 on DV at the reference level of IV2.