11. Effects Coding (Sum to Zero) Flashcards

1
Q

What is effects coding?

A

Assign different weights to certain levels of a categorical variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the issue of under identification?

A

Need a reference group as we want a model that represents our data but we have more parameters than group means so need to estimate with one parameter less as otherwise we are estimating too much with too little

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What fixes the issue of under identification?

A

Constraints (Sum to Zero)

Reducing parameters mean we can estimate categorical models

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What would our coefficients look like if one of the IVs was a reference group? (Use hospital example)

A

Treatment A = B0
Treatment B = B0 + B1
Treatment C = B0 + B2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What would our coefficients look like if we were comparing against the grand mean?

A

yij = μ + βj + ϵij

where
yij is the score for a given individual (i) in a given group (j)
μ is the grand mean
βj is a group specific effect
ϵij is the individual deviation from the group mean

So group mean =

mean - grand mean

Sum to Zero constraint: This means sum of all the coefficients would be equal to zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why do we not want to use dummy coding all the time?

A

Can compare grand mean/overall mean

Group 1 vs Group 2,3,4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you create a contrast matrix?

A

Focal group = 1
Observations in last group = -1
For all others in group = 0
Create k-1 variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the code used for effect coding in r and how does it differ to dummy coding?

A

contr.sum for effect coding compared to contr.var for dummy coding

Should produce the same outcomes in anova

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would you calculate the dropped variable from the interpretation?

A

beta 0 - (beta 1 + beta 2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly