Hello,
In my dataset I have sets of variables that belong to different instruments. Currently, each observation contains data from each variable. However, I want each observation to contain only data from one instrument. Thus, for n instruments and m observations, I need nm observations in my new dataset. To illustrate:
I have:
I want:
Whats a nice way to go about this?
Thanks so much,
Reese
In my dataset I have sets of variables that belong to different instruments. Currently, each observation contains data from each variable. However, I want each observation to contain only data from one instrument. Thus, for n instruments and m observations, I need nm observations in my new dataset. To illustrate:
I have:
obs | id | var1 | var2 | var3 | var4 |
1 | 1 | red | blue | dog | cat |
2 | 2 | yellow | green | mouse | bird |
obs | id | instrument | var1 | var2 | var3 | var4 |
1 | 1 | colors | red | blue | ||
2 | 1 | animals | dog | cat | ||
3 | 2 | colors | yellow | green | ||
4 | 2 | animals | mouse | bird |
Thanks so much,
Reese
Comment