I'm new to stats and I'm not sure how to interpret the output of my glm model.
I have two fixed factors, task which has two levels (task A and task B), and condition which has four levels (conditions a, b, c, and d). Both factors are sum-coded (because I don't have a clear baseline/reference level).
> contrasts(data$condition_c) <- contr.sum(4)
> contrasts(data$condition_c)
[,1] [,2] [,3]
a 1 0 0
b 0 1 0
c 0 0 1
d -1 -1 -1
> contrasts(data$task_c) <- contr.sum(2)
> contrasts(data$task_c)
[,1]
taskA 1
taskB -1
My dependent variable is binary so I'm using logistic regression. The model output looks like this:
Call:
glm(formula = DV ~ task_c * condition_c, family = "binomial",
data = data)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.3678 -1.0629 0.3536 0.9301 1.8400
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.26432 0.07572 3.491 0.000482 ***
task_c1 0.20972 0.07572 2.770 0.005611 **
condition_c1 -0.22247 0.11058 -2.012 0.044237 *
condition_c2 -0.09502 0.11226 -0.846 0.397350
condition_c3 1.98070 0.16615 11.921 < 0.0000000000000002 ***
task_c1:condition_c1 -0.22080 0.11058 -1.997 0.045856 *
task_c1:condition_c2 0.23499 0.11226 2.093 0.036332 *
task_c1:condition_c3 0.28610 0.16615 1.722 0.085087 .
Can anyone help me understand the main effect of condition and the interaction between task and condition? Thanks!
Am I correct to say that for the main effect of condition, the model summary says that while conditions a and c are significantly different from the grand mean, condition b isn't? What about condition d? And I'm completely lost for the interaction.
car
oremmeans
packages) to evaluate your hypotheses reliably. I find treatment contrasts easier to explain than sum contrasts; the model is fundamentally the same regardless of how the predictors are coded. It doesn't really matter whether or not you have clear baseline/reference levels for your categorical predictors; you can still just choose 1 as reference arbitrarily (or let R do it for you). $\endgroup$