I have a df called diff_colour_valid_int1:
> head(diff_colour_valid_int1)
# A tibble: 6 x 5
# Groups: search_difficulty, cue_validity [3]
search_difficulty cue_validity cue_colour meanrt stdev
<fct> <fct> <fct> <dbl> <dbl>
1 difficult FALSE Match (Color) cue 0.990 0.158
2 difficult FALSE Mismatch (Onset) cue 0.972 0.150
3 difficult TRUE Match (Color) cue 0.828 0.133
4 difficult TRUE Mismatch (Onset) cue 0.881 0.177
5 easy FALSE Match (Color) cue 0.813 0.132
6 easy FALSE Mismatch (Onset) cue 0.801 0.137
>
I want to add a column called cue_effect that calculates the difference between the meanrt values for each cue_validity pair (e.g. the first two FALSE FALSE). So the first six values of the column would be:
cue_effect
<dbl>
0.018
0.018
-0.053
-0.053
0.012
Any suggestions are appreciated. Thanks.