For my experiment, we have a column called "stimulus" that has numerous values that range from 1-50. Subjects were shown 4 groups of stimuli:
Block 1 = 1, 5, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 43, 47
Block 2 = 2, 6, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 44, 48
Block 3 = 3, 7, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 45, 49
Block 4 = 4, 8, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 46, 50
General patterning for each group:
from the initial number + 4 twice then + 2 for the next 15 numbers then + 4 twice
I was wondering if there was a loop function or other function of some sort that could create a new column grouping the stimulus into these 4 groups? I was initially creating a ifelse statement and individually putting in values, but it was getting too long, messy and confusing. So I was hoping there was an easier and cleaner solution to achieve this?
Any help is appreciated, thanks!