I recently ran an experiment that asked each participant to fill out a scale for each of the stimuli presented my data now looks something like this:
Participant Stim1_1 Stim1_2 Stim1_3 Stim2_1 Stim2_2 Stim2_3 Stim3_1 Stim3_2 Stim3_3
A
B
With multiple stimuli and multiple scale items. I want to pivot this to make it a long dataset, with each stimulus having its own row with each of the items making up their own column, something like this:
Participant Stim Item1 Item2 Item3
A 1
A 2
A 3
B 1
B 2
B 3
If that makes sense. I was thinking about using pivot_longer, but that seems to make a new row for each stimulus and item, so that stimulus 1, item 1 would have its own row, as well as stimulus 1, item 2, etc. Are there any ways to do this?