For my research I gave students a motivation survey at several points throughout the semester to see how motivation changes over time. The survey measures five motivational constructs. My dataset looks like this:
SUID is the identifier, T is the time I gave the survey (SM1, SM2, SM3, and SM4), and SE_A - CLB_A are the motivational constructs measured by the survey.
I would like to make a line graph showing change in motivational constructs over time. To do this, I want to reorganize my data to have the following columns:
SUID T Construct Value
So, for example, each student would have 5 rows for each timepoint (there are four timepoints and five constructs).
I used the following code to try and transpose my data:
/** transpose some of the data **/
proc transpose data=all out=transposed name=construct;
by notsorted SUID notsorted T;
var SE_A TV_A IGO_A EGO_A CLB_A;
id SUID;
run;
and my resulting data looks like this:
Is there a way that I can combine all of the columns labeled with SUID numbers into one column called "Value" without having to type out each SUID number in my code? Or is there a better way to transpose my data to get my desired outcome?
Thank you in advance!