<?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: Transpose in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12598#M877</link>
    <description>Thanks for the response. I was thinking in terms of a retain statement, and got lost!!&lt;BR /&gt;
&lt;BR /&gt;
Sars</description>
    <pubDate>Mon, 21 Apr 2008 17:40:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-04-21T17:40:27Z</dc:date>
    <item>
      <title>Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12596#M875</link>
      <description>Hello Everyone,&lt;BR /&gt;
&lt;BR /&gt;
I am having trouble with finding the total score (tot_score) for the following data.  My data has three variables (subject, visit, score) and it has the form:&lt;BR /&gt;
&lt;BR /&gt;
100 1 60&lt;BR /&gt;
100 2 62&lt;BR /&gt;
100 3 62&lt;BR /&gt;
100 4 65&lt;BR /&gt;
100 5 70&lt;BR /&gt;
101 1 58&lt;BR /&gt;
101 2 59&lt;BR /&gt;
101 3 62&lt;BR /&gt;
101 4 63&lt;BR /&gt;
101 5 65&lt;BR /&gt;
&lt;BR /&gt;
I could transpose the data and get a final dataset with two obs (one for subject 100 and another for subject 101).  I am not able to get any value for the newly introduced variable tot_score.&lt;BR /&gt;
&lt;BR /&gt;
Also, I have one more question:  If any of the visit is missing for any patient, what precaution I need to take?&lt;BR /&gt;
&lt;BR /&gt;
Thanks and Regards&lt;BR /&gt;
Sars</description>
      <pubDate>Mon, 21 Apr 2008 17:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12596#M875</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-21T17:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12597#M876</link>
      <description>I would just use a PROC SQL&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
CREATE TABLE WORK.TOTALS AS&lt;BR /&gt;
SELECT SUBJECT, SUM(SCORE) AS TOT_SCORE&lt;BR /&gt;
FROM WORK.DATA&lt;BR /&gt;
GROUP BY SUBJECT;&lt;BR /&gt;
&lt;BR /&gt;
On how to deal with missing visits, it is really not a coding question, it is more a methdological protocol question. What is the protocol for dealing with missing scores/visits in your research? For example, some leave them out, some fill in with the average, some fill in with the extrapolated value. The point is, there is no real one way to deal with missing data, you have to have a protocol that is based on your research on what to do about them.&lt;BR /&gt;
&lt;BR /&gt;
Ike Eisenhauer</description>
      <pubDate>Mon, 21 Apr 2008 17:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12597#M876</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-21T17:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12598#M877</link>
      <description>Thanks for the response. I was thinking in terms of a retain statement, and got lost!!&lt;BR /&gt;
&lt;BR /&gt;
Sars</description>
      <pubDate>Mon, 21 Apr 2008 17:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12598#M877</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-04-21T17:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12599#M878</link>
      <description>Hi:&lt;BR /&gt;
  In addition to PROC SQl, there are other methods of creating either reports or SAS datasets from your data:&lt;BR /&gt;
[pre] &lt;BR /&gt;
  &lt;BR /&gt;
proc means data=visit sum n nway;&lt;BR /&gt;
  title '1) Proc Means Report';&lt;BR /&gt;
  class subject;&lt;BR /&gt;
  var score;&lt;BR /&gt;
  output out=mnout sum=totscore n=num_vis;&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc tabulate data=visit f=comma8. out=work.tabout;&lt;BR /&gt;
  title '2) Proc Tabulate Report';&lt;BR /&gt;
  class subject visit;&lt;BR /&gt;
  var score;&lt;BR /&gt;
  table subject,&lt;BR /&gt;
        score * (sum='Tot Score' n='Num Visit')&lt;BR /&gt;
        / rts=10;&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc tabulate data=visit f=comma8.;&lt;BR /&gt;
  title '3) Proc Tabulate Report with Columns for IDs';&lt;BR /&gt;
  class subject visit;&lt;BR /&gt;
  var score;&lt;BR /&gt;
  table subject*&lt;BR /&gt;
        score * (sum='Tot Score' n='Num Visit')&lt;BR /&gt;
        / rts=10;&lt;BR /&gt;
run;&lt;BR /&gt;
      &lt;BR /&gt;
proc report data=visit nowd out=work.repout;&lt;BR /&gt;
  title '4) Proc Report Output';&lt;BR /&gt;
  column subject score n;&lt;BR /&gt;
  define subject / group 'Subject';&lt;BR /&gt;
  define score / sum 'Tot Score';&lt;BR /&gt;
  define n / 'Num Visit';&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc print data=mnout;&lt;BR /&gt;
  title 'Data Set created by Proc Means #1';&lt;BR /&gt;
run;&lt;BR /&gt;
   &lt;BR /&gt;
proc print data=tabout;&lt;BR /&gt;
  title 'Data Set created by Proc Tabulate #2';&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc print data=repout;&lt;BR /&gt;
  title 'Data Set created by Proc Report #4';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
And you could use a DATA step program, as well. I'd consider this a how to summarize or create a summary data set problem more than a TRANSPOSE problem.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 21 Apr 2008 17:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Transpose/m-p/12599#M878</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-04-21T17:43:51Z</dc:date>
    </item>
  </channel>
</rss>

