I need to run a logistic regression with a binary response variable and a categorical explanatory variable.
My explanatory variable has 3 levels:
I would like to find a way to test the significance of all 3 possible contrasts:
- Plantation1 vs. Forest
- Plantation2 vs. Forest
- Plantation1 vs. Plantation2
I have coded my categorical variable as 2 dummy variables (Plantation1 and Plantation2), using Forest as the "reference" group, which allows me to test the first 2 contrasts. If I recode the dummy variables using Plantation1 as the "reference" group, I can run the regression again and test the 1st and 3rd contrasts, giving me all the information I need.
Is this approach statistically "wrong"? If so, why?
UPDATE: Thanks to fg nu's answer, I have found a function in R that does multiple comparisons for main effects: the
glht function in the