I ran an experiment where participants had to perform perceptual tasks and were assigned to 1 of 3 experimental conditions. In two of the three conditions, participants performed that task in groups of size 5. In the last condition, participants performed the task independently. I am trying to measure the effect of my experimental conditions on the performance of individuals.
I want to compare the performance difference-in-means between participants assigned to condition 1 versus participants assigned to condition 2 (both conditions are done in groups, with different settings).
#(treatment is binary indicating the experimental condition) fit <- lm(performance ~ treatment , data=df) tidy(fit)
How can I extend this code to account for dependencies between data points within groups? (I have a variable 'group_id' for each participant)
Also, how do I compare participants assigned to condition 2 versus participants assigned to condition 3 (participants in condition 3 did the task independently, while condition 2 did it in a group -- hence the within group dependency)