I am struggling with interpreting coefficients from a multiple regression analysis with multiple categorical (dummy) variables. I am running a linear mixed model with biodiversity (
LnS_Add1) as independent variable, and several continuous and categorical dependent variables.
With a single categorical/dummy variable (e.g.
LnS_Add1 ~ AREA_AM_2.5 + System_Type3; where
AREA_AM_2.5 is continuous and
System_Type3 is categorical with 3 levels, i.e. Arable, Grassland and Orchard) this is pretty straightforward. In this case the intercept represents the mean of the reference dummy variable (e.g. Arable) and the mean of the 2nd and 3rd levels Grassland and Orchard can be calculated manually by adding intercept to the slope coefficient.
globmod1 <- lmer(LnS_Add1 ~ AREA_AM_2.5 + System_Type3 + (1|Study_Code/Pair_Code), data1_plant) summary(globmod1)
Fixed effects: Estimate Std. Error t value (Intercept) 0.3585534 0.1238470 2.895 AREA_AM_2.5 0.0004256 0.0001371 3.104 System_Type3Grassland -0.5227684 0.0915722 -5.709 System_Type3Orchard -0.4057969 0.5477567 -0.741
To get a summary output that shows the means of both Arable, Grassland and Orchard in R I suppress the intercept by adding a -1 (or +0) to the model.
globmod1.coef <- lmer(LnS_Add1 ~ AREA_AM_2.5 + System_Type3 -1 + (1|Study_Code/Pair_Code), data1_plant) summary(globmod1.coef)
Fixed effects: Estimate Std. Error t value AREA_AM_2.5 0.0004256 0.0001371 3.104 System_Type3Arable 0.3585534 0.1238470 2.895 System_Type3Grassland -0.1642149 0.1341851 -1.224 System_Type3Orchard -0.0472434 0.5457304 -0.087
But what do I do if I have multiple categorical variables (e.g.
LnS_Add1 ~ AREA_AM_2.5 + System_Type3 + Habitat2; where Habitat2 is a categorical variable with 3 levels, i.e. Farm aggregated, Outside field, and Within field)?. Now the intercept represents the mean of the reference level of a combination of
Habitat2 (e.g. all data in arable systems and measured at farm aggregate level). But what I am interested in are the means for the different levels of each of my 2 categorical variables, holding everything else constant.
How do I create a summary table that contains means of all levels of all categorical variables in my model? The -1 command doesnt help me anymore, as it removes the intercept but the intercept now represents a mean of 2 reference dummy variables. I am only interested here in the fixed effect estimates, not in any hypothesis testing.