<?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: Longitudinal data - programming in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438335#M109274</link>
    <description>And the variable with the results is called OUTCOME not nb_yes, that was the original variable.</description>
    <pubDate>Mon, 19 Feb 2018 03:38:28 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-19T03:38:28Z</dc:date>
    <item>
      <title>Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436541#M108567</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have a mock data that collect in 3 years: 2002, 2003 2005.&lt;/P&gt;
&lt;P&gt;Variables are: fd, cl, hs, hl, all coded to 1 (yes) or 0 (no); with&amp;nbsp;sub_id.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input id $ fd cl hs hl 2002 2003 2005;
datalines; 
1 1 1 0 . 1 0 0 . 1 1 0 1 
2 1 0 1 1 0 0 1 1 1 0 1 1
3 1 . 0 0 1 . 0 0 1 1 . 0 
5 1 1 1 0 0 1 1 1 . 1 0 0
...
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to&amp;nbsp;have outcomes&amp;nbsp;as below:&lt;/P&gt;
&lt;P&gt;a) Highly severe: In&amp;nbsp;EACH&amp;nbsp;surveyed year, if a subject responded "yes" to ALL fd, cl, hs,&amp;nbsp;hl.&lt;/P&gt;
&lt;P&gt;b) Severe&lt;SPAN&gt;: In&amp;nbsp;EACH&amp;nbsp;surveyed&amp;nbsp;year, if a subject responded "yes" at least TWO-THREE to fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;c) Moderate: In&amp;nbsp;EACH&amp;nbsp;surveyed year,&amp;nbsp;if a subject responded "yes" at least ONE to fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;d) Mild:&amp;nbsp;In&amp;nbsp;ANY surveyed year, if a subject responded&amp;nbsp;"yes" at least ONE to&amp;nbsp;fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;e) None:&amp;nbsp;In EACH&amp;nbsp;surveyed year,&amp;nbsp;if a subject responded "no" to ALL fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, the data step, should I do them in wide data or long data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Much appreciate for your help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Phan S.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 03:07:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436541#M108567</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-13T03:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436548#M108572</link>
      <description>&lt;P&gt;I'm not getting a feel for your data. You have more variables listed than in your datelines and you can't name variables 2003 so that wouldn't work anyways.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create at least two arrays, one for years, one for data. I'm assuming that if there is no survey then it's missing and not zero.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a) Highly severe: In&amp;nbsp;EACH&amp;nbsp;surveyed year, if a subject responded "yes" to ALL fd, cl, hs,&amp;nbsp;hl. &lt;FONT color="#008000"&gt;&lt;STRONG&gt;-&amp;gt; Add them all together and see if they add to the expected number, sum of years * number of variables you're checking.&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;b) Severe&lt;SPAN&gt;: In&amp;nbsp;EACH&amp;nbsp;surveyed&amp;nbsp;year, if a subject responded "yes" at least TWO-THREE to fd, cl, hs, hl. &lt;STRONG&gt;&lt;FONT color="#008000"&gt;-&amp;gt; add them all together and check if sum to higher than the minimum required&amp;nbsp;number, 2*nYears&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That should give you an idea of&amp;nbsp;how these can be calculated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31493"&gt;@PhanS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have a mock data that collect in 3 years: 2002, 2003 2005.&lt;/P&gt;
&lt;P&gt;Variables are: fd, cl, hs, hl, all coded to 1 (yes) or 0 (no); with&amp;nbsp;sub_id.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input id $ fd cl hs hl 2002 2003 2005;
datalines; 
1 1 1 0 . 1 0 0 . 1 1 0 1 
2 1 0 1 1 0 0 1 1 1 0 1 1
3 1 . 0 0 1 . 0 0 1 1 . 0 
5 1 1 1 0 0 1 1 1 . 1 0 0
...
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to&amp;nbsp;have outcomes&amp;nbsp;as below:&lt;/P&gt;
&lt;P&gt;a) Highly severe: In&amp;nbsp;EACH&amp;nbsp;surveyed year, if a subject responded "yes" to ALL fd, cl, hs,&amp;nbsp;hl.&lt;/P&gt;
&lt;P&gt;b) Severe&lt;SPAN&gt;: In&amp;nbsp;EACH&amp;nbsp;surveyed&amp;nbsp;year, if a subject responded "yes" at least TWO-THREE to fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;c) Moderate: In&amp;nbsp;EACH&amp;nbsp;surveyed year,&amp;nbsp;if a subject responded "yes" at least ONE to fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;d) Mild:&amp;nbsp;In&amp;nbsp;ANY surveyed year, if a subject responded&amp;nbsp;"yes" at least ONE to&amp;nbsp;fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;e) None:&amp;nbsp;In EACH&amp;nbsp;surveyed year,&amp;nbsp;if a subject responded "no" to ALL fd, cl, hs, hl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, the data step, should I do them in wide data or long data.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Much appreciate for your help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Phan S.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 03:19:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436548#M108572</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-13T03:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436552#M108574</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE; 
  input ID @; 
  do YEAR=2002 to 2004;
    input FD CL HS HL @;    
    output; 
  end;
cards; 
1 1 1 0 . 1 0 0 . 1 1 0 1 
2 1 0 1 1 0 0 1 1 1 0 1 1
3 0 . 0 0 0 . 0 0 0 0 . 0 
5 1 1 1 1 1 1 1 1 1 1 1 1
run;
proc sql;
  create table WANT as 
  select ID
       , case when min(NB_YES)=4 then 'Highly severe'
              when min(NB_YES)&amp;gt;1 then 'Severe'
              when min(NB_YES)=1 then 'Moderate'
              when min(NB_YES)=0 then 'None'
              else                    'Mild' end as OUTCOME
  from (
    select ID
         , YEAR
         , sum(FD, CL, HS, HL) as NB_YES
    from HAVE 
    group by ID, YEAR
       )
  group by ID;
quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ID OUTCOME&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;1&amp;nbsp; Moderate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2&amp;nbsp; Severe&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;3&amp;nbsp; None&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;5&amp;nbsp; Highly severe&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 03:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436552#M108574</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-13T03:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436556#M108577</link>
      <description>&lt;P&gt;Also: Wide data is seldom a good idea. I created a long table.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 03:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436556#M108577</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-13T03:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436705#M108644</link>
      <description>&lt;P&gt;Appear not working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I run proc freq from proc SQL?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, can you tell me how can I random extract a data?&lt;/P&gt;
&lt;P&gt;Example, I want to randomize extract and have a data of 50 subjects out from the original data of 2000+ subject.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 14:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436705#M108644</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-13T14:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436759#M108667</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31493"&gt;@PhanS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Appear not working.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does that mean? Did SAS explode?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;How can I run proc freq from proc SQL?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can't and more importantly shouldn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, can you tell me how can I random extract a data?&lt;/P&gt;
&lt;P&gt;Example, I want to randomize extract and have a data of 50 subjects out from the original data of 2000+ subject.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SURVEYSELECT will select Random Samples.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 15:46:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436759#M108667</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-13T15:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436764#M108671</link>
      <description>&lt;P&gt;No - SAS did not explode.&lt;/P&gt;
&lt;P&gt;I need you give me a full syntax of&amp;nbsp;&lt;SPAN&gt;PROC SURVEYSELECT will select Random Samples.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 15:54:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436764#M108671</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-13T15:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436769#M108675</link>
      <description>&lt;P&gt;In longitudinal data collection you are more likely to have multiple data sets hopefully with a variable to contain the period identification.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test1;
input id $ fd cl hs hl ;
year=2002;
datalines; 
1 1 1 0 .  
2 1 0 1 1 
3 1 . 0 0  
5 1 1 1 0 
;
run;

data test2;
input id $ fd cl hs hl ;
year=2003;
datalines; 
1 1 1 0 1  
2 1 0 0 . 
3 0 0 1 0  
5 0 0 1 0 
;
run;

data test3;
input id $ fd cl hs hl ;
year=2005;
datalines; 
1 0 1 1 1  
2 1 1 1 1 
3 0 0 1 0  
4 1 1 1 0 
;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(yes I intentionally don't have id 5 in the third set. It happens with longitudinal studies - if your data doesn't have that thank the stars)&lt;/P&gt;
&lt;P&gt;which you combine with append or set:&lt;/P&gt;
&lt;PRE&gt;data all;
   set test1 test2 test3;
run;&lt;/PRE&gt;
&lt;P&gt;Which lends itself (actually in the last data step) to creating one or more variables that have values based on fd cl hs hl. If you variable are 0/1 with 1 =yes then sum (fd,cl,hs,hl); gives the number of "yes" per respondent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then summarize that data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It isn't clear from your example if "each year" means the same client in every year, or if any client in the year had a response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on which what your combinations of each year and a client or any client or what ever, then summarize with Proc means/summary with year or id (or both) as class variables.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 16:01:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436769#M108675</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-13T16:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436837#M108696</link>
      <description>&lt;P&gt;what do you mean not working? You have the full code including the (working) output.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 19:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436837#M108696</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-13T19:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436840#M108699</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31493"&gt;@PhanS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;No - SAS did not explode.&lt;/P&gt;
&lt;P&gt;I need you give me a full syntax of&amp;nbsp;&lt;SPAN&gt;PROC SURVEYSELECT will select Random Samples.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can check the SAS documentation with the examples section first and make an attempt.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need things, you usually pay for them. If you do need a consultant feel free to PM me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you want help, well, help is free as long as you respectfully phrase your questions and comments but it doesn't mean doing your work for you or providing full working code to solve ambiguous problems on demand.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 19:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436840#M108699</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-13T19:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436933#M108733</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, if you feel I am disrespect you. I don't mean this to you and anyone. My English is not primary.&lt;/P&gt;
&lt;P&gt;And thanks for your help/comment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Phan S.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 00:09:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436933#M108733</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-14T00:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436934#M108734</link>
      <description>&lt;P&gt;Dear Ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks you for your time and I am going to test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Phan S.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 00:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/436934#M108734</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-14T00:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/437377#M108884</link>
      <description>&lt;P&gt;Hello ChrisNZ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for my delay. I accept your code as the solution. There is an issue, the outcomes came out only four categories. I played around but still give me only four.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are welcome to test. BTW, I thank you for you time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE; 
  input ID @; 
  do YEAR=2002 to 2004;
    input FD CL HS HL @;    
    output; 
  end;
cards; 
1 1 1 1 1  1 1 1 1  1 1 1 1
2 1 1 1 .  1 1 0 .  1 1 0 1 
3 1 0 0 0  0 0 1 1  1 0 . 1
4 1 0 0 .  0 0 0 .  1 . 0 0
5 0 . 0 0  0 . 0 0  0 0 . 0 
6 1 1 1 1  1 1 1 1  1 1 1 1
7 1 1 1 .  1 1 0 .  1 1 0 1 
8 1 0 0 0  0 0 1 1  1 0 . 1
9 1 0 0 .  0 0 0 .  1 . 0 0
10 0 . 0 0  0 . 0 0  0 0 . 0 
run;
proc sql;
  create table WANT as 
  select ID
       , case when min(NB_YES)=4 then 'Highly severe'
              when 2=min(NB_YES)&amp;lt;4 then 'Severe'
              when min(NB_YES)=1 then 'Moderate'
              when min(NB_YES)=0 then 'None'
              else                    'Mild' end as OUTCOME_2
  from (
    select ID
         , YEAR
         , sum(FD, CL, HS, HL) as NB_YES
    from HAVE 
    group by ID, YEAR
       )
  group by ID;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Feb 2018 00:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/437377#M108884</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-15T00:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/437384#M108889</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;min&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;NB_YES&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is always true as 0 or 1 are &amp;lt; 4&lt;/P&gt;
&lt;P&gt;Stick to the original syntax.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 00:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/437384#M108889</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-15T00:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438174#M109213</link>
      <description>&lt;P&gt;Dear Chris,&lt;/P&gt;
&lt;P&gt;my apology to disturb you. I re-run the code, but I am not sure why "outcome" does exist in work.outcome.data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking for your advice. Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Phan S.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 17:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438174#M109213</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-17T17:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438199#M109224</link>
      <description>&lt;P&gt;Code and log because we can't see your computer.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 21:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438199#M109224</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-17T21:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438323#M109265</link>
      <description>&lt;P&gt;I don't understand what the issue is.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 02:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438323#M109265</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-19T02:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438329#M109269</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;9653  data HAVE;
9654    input ID @;
9655    do YEAR=2002 to 2004;
9656      input FD CL HS HL @;
9657      output;
9658    end;
9659  cards;

NOTE: The data set WORK.HAVE has 30 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.00 seconds


9670  run;
9671
9672  proc sql;
9673    create table WANT as
9674    select ID
9675         , case when min(NB_YES)=4 then 'Highly severe'
9676                when min(NB_YES)&amp;gt;1 then 'Severe'
9677                when min(NB_YES)=1 then 'Moderate'
9678                when min(NB_YES)=0 then 'None'
9679                else                    'Mild'
9680    end as OUTCOME
9681    from (
9682      select ID
9683           , YEAR
9684           , sum(FD, CL, HS, HL) as NB_YES
9685      from HAVE
9686      group by ID, YEAR
9687         )
9688    group by ID;
NOTE: A GROUP BY clause has been discarded because neither the SELECT clause nor the
      optional HAVING clause of the associated table-expression referenced a summary
      function.
NOTE: Table WORK.WANT created, with 10 rows and 2 columns.

9689  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.28 seconds
      cpu time            0.04 seconds


9690  proc freq data=outcome;
ERROR: File WORK.OUTCOME.DATA does not exist.
9691  tables nb_yes;
ERROR: No data set open to look up variables.
9692  run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hello, Reeza: Please kindly see the log and code below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE; 
  input ID @; 
  do YEAR=2002 to 2004;
    input FD CL HS HL @;    
    output; 
  end;
cards; 
1 1 1 1 1  1 1 1 1  1 1 1 1
2 1 1 1 .  1 1 0 .  1 1 0 1 
3 1 0 0 0  0 0 1 1  1 0 . 1
4 1 0 0 .  0 0 0 .  1 . 0 0
5 0 . 0 0  0 . 0 0  0 0 . 0 
6 1 1 1 1  1 1 1 1  1 1 1 1
7 1 1 1 .  1 1 0 .  1 1 0 1 
8 1 0 0 0  0 0 1 1  1 0 . 1
9 1 0 0 .  0 0 0 .  1 . 0 0
10 0 . 0 0  0 . 0 0  0 0 . 0 
run;

proc sql;
  create table WANT as 
  select ID
       , case when min(NB_YES)=4 then 'Highly severe'
              when min(NB_YES)&amp;gt;1 then 'Severe'
              when min(NB_YES)=1 then 'Moderate'
              when min(NB_YES)=0 then 'None'
              else                    'Mild' 
  end as OUTCOME
  from (
    select ID
         , YEAR
         , sum(FD, CL, HS, HL) as NB_YES
    from HAVE 
    group by ID, YEAR
       )
  group by ID;
quit;

proc sort data=outcome;
proc print data=want;
var id;
run;

proc freq data=outcome;
tables nb_yes;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Feb 2018 03:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438329#M109269</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-19T03:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438331#M109271</link>
      <description>&lt;P&gt;Really?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The table is called WANT in your code, not OUTCOME.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 03:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438331#M109271</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-19T03:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Longitudinal data - programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438334#M109273</link>
      <description>&lt;P&gt;PROC SORT has no BY statement either.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 03:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Longitudinal-data-programming/m-p/438334#M109273</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-19T03:36:33Z</dc:date>
    </item>
  </channel>
</rss>

