<?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 Descriptives Statistics on Longitudinal (Long) Data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/413871#M101346</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set in long format (varied number of observations per subject) with 5 outcome variables. However, not all outcome variables are measures in each observations. I want to get means for each outcome variable the first time it is observed across subjects.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, using first.id does not work (the first observation per subject doesn't necessarily have the first measure of that outcome).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;doing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF first.id AND first.outcome then output&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does not work either.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2017 03:05:04 GMT</pubDate>
    <dc:creator>LGrau</dc:creator>
    <dc:date>2017-11-16T03:05:04Z</dc:date>
    <item>
      <title>Descriptive Statistics for Longitudinal (long) Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/413869#M101341</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set in long format (varied number of observations per subject) with 5 outcome variables. However, not all outcome variables are measures in each observations. I want to get means for each outcome variable the first time it is observed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, using first.id does not work (the first observation per subject doesn't necessarily have the first measure of that outcome).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;doing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF first.id AND first.outcome then output&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does not work either.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 03:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/413869#M101341</guid>
      <dc:creator>LGrau</dc:creator>
      <dc:date>2017-11-16T03:03:00Z</dc:date>
    </item>
    <item>
      <title>Descriptives Statistics on Longitudinal (Long) Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/413871#M101346</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set in long format (varied number of observations per subject) with 5 outcome variables. However, not all outcome variables are measures in each observations. I want to get means for each outcome variable the first time it is observed across subjects.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, using first.id does not work (the first observation per subject doesn't necessarily have the first measure of that outcome).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;doing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF first.id AND first.outcome then output&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does not work either.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 03:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/413871#M101346</guid>
      <dc:creator>LGrau</dc:creator>
      <dc:date>2017-11-16T03:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Descriptives Statistics on Longitudinal (Long) Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/413876#M101347</link>
      <description>&lt;P&gt;Relatively trivial to accomplish this, here are the steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create flags for each measure, set to 0&lt;/P&gt;
&lt;P&gt;2. If this is the first non missing and flag is not set, store it to a new variable and set flag&lt;/P&gt;
&lt;P&gt;3. At first iteration of each group set flags and values back to missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need further help, provide data in a data step so that we can work with data. It doesn't need to exactly your data but needs to reflect what you have.&amp;nbsp;&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/169798"&gt;@LGrau&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set in long format (varied number of observations per subject) with 5 outcome variables. However, not all outcome variables are measures in each observations. I want to get means for each outcome variable the first time it is observed across subjects.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, using first.id does not work (the first observation per subject doesn't necessarily have the first measure of that outcome).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;doing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF first.id AND first.outcome then output&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does not work either.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 03:52:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/413876#M101347</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-16T03:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Descriptives Statistics on Longitudinal (Long) Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/414016#M101403</link>
      <description>&lt;P&gt;I'm sorry, I'm not sure what you mean by flags. Here's a sample data set. As you can see, some outcomes are missing until the third observation on the same person. I would need to find the means each outcome the first time it is recorded in each individual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.SOURCE;&lt;BR /&gt;INFILE DATALINES DELIMITER= ',' DSD MISSOVER;&lt;BR /&gt;INPUT&lt;BR /&gt;SubjID&lt;BR /&gt;TxGrp :$5.&lt;BR /&gt;SexCd :$1.&lt;BR /&gt;EthCd&lt;BR /&gt;Outcome1&lt;BR /&gt;Outcome2&lt;BR /&gt;Outcome3;&lt;BR /&gt;DATALINES;&lt;BR /&gt;101,Arm A,F,1,45,,&lt;BR /&gt;101,Arm A,F,1,,3,2&lt;BR /&gt;101,Arm A,F,1,43,4,&lt;BR /&gt;102,Arm C,M,1,,5,,&lt;BR /&gt;102,Arm C,M,1,,4,3&lt;BR /&gt;102,Arm B,M,2,32,2,5&lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/414016#M101403</guid>
      <dc:creator>LGrau</dc:creator>
      <dc:date>2017-11-16T14:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Descriptives Statistics on Longitudinal (Long) Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/414063#M101417</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_random.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16674i458807D40F0DAAE4/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_random.JPG" alt="delete_random.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 16:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Descriptive-Statistics-for-Longitudinal-long-Data/m-p/414063#M101417</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-16T16:00:16Z</dc:date>
    </item>
  </channel>
</rss>

