<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help combining 400+ columns! in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690554#M24751</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=all out=transposed(rename=col1=value) name=construct; 
	by SUID  T notsorted; 
	var SE_A TV_A IGO_A EGO_A CLB_A; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Oct 2020 18:55:33 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2020-10-09T18:55:33Z</dc:date>
    <item>
      <title>Help combining 400+ columns!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690550#M24748</link>
      <description>&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 485px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50502i6350B844DFC67201/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUID&amp;nbsp; &amp;nbsp;T&amp;nbsp; &amp;nbsp;Construct&amp;nbsp; &amp;nbsp;Value&lt;/P&gt;&lt;P&gt;So, for example, each student would have 5 rows for each timepoint (there are four timepoints and five constructs).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code to try and transpose my data:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/** 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;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and my resulting data looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture3.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50504iE4761BCDBE81AF4E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture3.PNG" alt="Capture3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;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?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 18:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690550#M24748</guid>
      <dc:creator>mcmaxwell</dc:creator>
      <dc:date>2020-10-09T18:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help combining 400+ columns!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690552#M24749</link>
      <description>What happens if you remove the ID statement entirely?&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Oct 2020 18:52:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690552#M24749</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-09T18:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help combining 400+ columns!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690554#M24751</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=all out=transposed(rename=col1=value) name=construct; 
	by SUID  T notsorted; 
	var SE_A TV_A IGO_A EGO_A CLB_A; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Oct 2020 18:55:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690554#M24751</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-10-09T18:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help combining 400+ columns!</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690567#M24757</link>
      <description>&lt;P&gt;You are making harder to create any sort of comparison across time graph with this approach.&lt;/P&gt;
&lt;P&gt;You would be better off if your "time" variable were some sort of number in all likelihood, even just a integer representing order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By making a separate variable for each subject/time it just gets harder to make any sort of meaningful graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
  input id time measure1 measure2;
datalines;
1 1 25 22
2 1 33 34
3 1 47 49
1 2 22 20
2 2 36 31
3 2 46 49
1 3 28 21
2 3 38 32
3 3 37 39
1 4 21 29
2 4 34 31
3 4 46 41
1 5 29 23
2 5 40 45
3 5 49 43
;

proc sgplot data=example;
 title "All id same measure";
 series x=time y=measure1/group=id;
run;

proc sort data=example;
   by id;
run;

proc sgplot data=example;
 title "By id all measures";
 by id;
 series x=time y=measure1/;
 series x=time y=measure2/;
 yaxis label='Score';

run; title;
&lt;/PRE&gt;
&lt;P&gt;Now, manipulate the above example data set the same way and make graphs.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2020 19:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-combining-400-columns/m-p/690567#M24757</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-09T19:27:32Z</dc:date>
    </item>
  </channel>
</rss>

