I would like to reduce the following data frame:
Subject, Run, Condition, DV
1, 1, 1, 123
1, 1, 2, 456
1, 1, 3, 789
1, 2, 1, 123
1, 2, 2, 456
1, 2, 3, 789
2, 1, 1, 123
2, 1, 2, 456
2, 1, 3, 789
2, 2, 1, 123
2, 2, 2, 456
2, 2, 3, 789
To this data frame:
Subject, Run, coeff(lm(DV ~ Condition))
1, 1, ???
1, 2, ???
2, 1, ???
2, 2, ???
Any ideas on how to approach this?