<?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: Average of observations between multiple specific dates in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403001#M3656</link>
    <description>&lt;P&gt;The bare minimum needed to replicate your issue. You know your data, I don't.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be a single record for one person - make sure you de-identify it and don't include variables that aren't relevant to the problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;See this post on how to post sample data as well:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Oct 2017 00:40:25 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-11T00:40:25Z</dc:date>
    <item>
      <title>Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/402982#M3647</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset where each patient (represented by ID) is prescribed a medication (represented by dose) over different time periods.&amp;nbsp;Here is an example of my data, where for particular purposes each patient does not have a fixed dose on each day:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;TD&gt;dose&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1/17/2008&lt;/TD&gt;&lt;TD&gt;7.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2/5/2008&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;5/7/2008&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;6/15/2008&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2/2/2008&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3/17/2008&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I also have another dataset of patients experiencing events (i.e., hospital readmission) at different times. Here is an example:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;date1&lt;/TD&gt;&lt;TD&gt;date2&lt;/TD&gt;&lt;TD&gt;date3&lt;/TD&gt;&lt;TD&gt;date4&lt;/TD&gt;&lt;TD&gt;date5&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;date20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2/20/2008&lt;/TD&gt;&lt;TD&gt;4/17/2008&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4/27/2008&lt;/TD&gt;&lt;TD&gt;6/7/2008&lt;/TD&gt;&lt;TD&gt;9/11/2008&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;…&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;where&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;each patient might experience different number of events, and&lt;/LI&gt;&lt;LI&gt;the maximum number of events occurred for any patient in my database is 20 (that's why I have "data20" as my last variable in the second table).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Now, for each patient, I want to measure the average dose used between each two consecutive events. Here are a couple of points:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The average is measured by taking the cumulative dose in that period and dividing it by the total number of days in that period.&lt;/LI&gt;&lt;LI&gt;If an event occurs for the first time, then two conditions may happen: whether the event occurs before or after the time of the first dose. For the former, the average dose in that period will be 0. For the latter, the average will be measured from the time of the first dose until that event.&lt;/LI&gt;&lt;LI&gt;It's possible that, for a patient, no event occurs. In this case, I take the average for the period between the first and last dose.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Finally, I'd be very thankful if the code can accommodate reading two separate data files (like the tables above).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 22:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/402982#M3647</guid>
      <dc:creator>Alireza_Boloori</dc:creator>
      <dc:date>2017-10-10T22:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/402993#M3652</link>
      <description>&lt;P&gt;Please post data that we can use and the expected output that lines up with that data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically an replicable example that we can use to write the code. I'm not making up data AND answering your question &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 00:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/402993#M3652</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-11T00:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/402999#M3655</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt; Thanks! The dataset is very large (50+ million observations). So, I was wondering how much of it would be required for you? Please let me know.</description>
      <pubDate>Wed, 11 Oct 2017 00:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/402999#M3655</guid>
      <dc:creator>Alireza_Boloori</dc:creator>
      <dc:date>2017-10-11T00:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403001#M3656</link>
      <description>&lt;P&gt;The bare minimum needed to replicate your issue. You know your data, I don't.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be a single record for one person - make sure you de-identify it and don't include variables that aren't relevant to the problem.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;See this post on how to post sample data as well:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 00:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403001#M3656</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-11T00:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403005#M3657</link>
      <description>&lt;P&gt;Here is a part of the data (I changed it for more clarification). The data that includes the time along with dose for each patient looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1;
input id date drug_dose;
datalines;
1 2008-01-17 7.5
1 2008-01-18 14.7
1 2008-01-19 21.5
1 2008-01-20 27.3
1 2008-01-21 32.1
1 2008-01-22 35.9
1 2008-01-23 38.6
1 2008-01-24 40.6
1 2008-01-25 41.8
1 2008-01-26 42.6
1 2008-03-01 129.4
1 2008-03-02 107.7
1 2008-03-03 86.2
1 2008-03-04 34.4
1 2008-03-05 9.1
2 2008-07-07 30
2 2008-07-08 59.1
2 2008-07-09 86
2 2008-07-10 109.4
2 2008-07-11 128.6
2 2008-07-12 143.6
2 2008-10-23 15
2 2008-10-24 29.5
2 2008-10-25 43
2 2008-10-26 54.7
2 2008-10-27 64.3
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also, the second dataset which contains the information about time of different events looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have2;
input id date1 date2 date3 date3 date4 date5;
datalines;
1 2008-2-6 2008-3-19
2 2008-5-9 2008-8-1 2008-9-5
3 2008-4-3 2008-6-5
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, the data I want to have looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input id avg_dose time_start time_stop;
datalines;
1 15.13 2008-1-17 2008-2-6 
1 13.585 2008-2-7 2008-3-5
1 0 2008-3-6 2008-3-19
2 0 2008-5-9 2008-7-6
2 12.268 2008-7-7 2008-8-1
2 0 2008-8-2 2008-9-5
2 4.05 2008-9-6 2008-10-27
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For example, 15.13 in the first row is obtained as 302.6/20, where&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;302.6 is the sum of dose values for patient #1 from 2008-1-17 until 2008-1-26, and&lt;/LI&gt;&lt;LI&gt;20 is the total number of days from 2008-1-17 until 2008-2-6.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I hope that this would be helpful. Once again, thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 01:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403005#M3657</guid>
      <dc:creator>Alireza_Boloori</dc:creator>
      <dc:date>2017-10-11T01:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403747#M3683</link>
      <description>&lt;P&gt;Since there hasn't been any solution for this question, can I repost it?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 01:41:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403747#M3683</guid>
      <dc:creator>Alireza_Boloori</dc:creator>
      <dc:date>2017-10-13T01:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403761#M3686</link>
      <description>&lt;P&gt;Feel free. Your question isn't clear, which is why I didn't try and answer it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;302.6 is the sum of dose values for patient #1 from 2008-1-17 until 2008-1-26, &lt;STRONG&gt;&amp;lt;- where do the dates come from?&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;What are the rules for determining the dates?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 02:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403761#M3686</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-13T02:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403792#M3697</link>
      <description>&lt;P&gt;For patient #1, the first event happened on 2008-2-6. Also, for this patient, the medication was prescribed for the first time on 2008-1-17 and lasted until 2008-1-26. So, the cumulative dose in these 10 days was 302.6. However, as I said in my original post, I want to return &lt;U&gt;&lt;STRONG&gt;the average dose used between each two consecutive event dates.&lt;/STRONG&gt;&lt;/U&gt; That's why I divide 302.6 by 20 (which is the time period from 2008-1-17 until 2008-2-6).&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 04:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403792#M3697</guid>
      <dc:creator>Alireza_Boloori</dc:creator>
      <dc:date>2017-10-13T04:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403968#M3710</link>
      <description>&lt;P&gt;Ok, that clarifies things. The explanation made it seem more complex.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create an episode variable that defines an episode for each ID. For example, 2008-1-17 to 2008-1-26 would be a single episode.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the DIF() function for this to calculate the EPISODE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Use PROC MEANS with ID and EPISODE (from #1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Merge it with your second data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can't figure out a step, post your code and log and we can help from there.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 14:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/403968#M3710</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-13T14:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404084#M3718</link>
      <description>&lt;P&gt;Thanks Reeza! I came up with this approach (which may be slightly different with what you recommended).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I merged two data sets like this (I'm showing the results for only patient #1):&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;id&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;date&lt;/SPAN&gt; drug_dose indicator&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;1 2008-01-17 7.5 .
1 2008-01-18 14.7 .
1 2008-01-19 21.5 .
1 2008-01-20 27.3 .
1 2008-01-21 32.1 .
1 2008-01-22 35.9 .
1 2008-01-23 38.6 .
1 2008-01-24 40.6 .
1 2008-01-25 41.8 .
1 2008-01-26 42.6 .&lt;BR /&gt;1 2008-02-06 . event
1 2008-03-01 129.4 .
1 2008-03-02 107.7 .
1 2008-03-03 86.2 .
1 2008-03-04 34.4 .
1 2008-03-05 9.1 .&lt;BR /&gt;1 2008-03-19 . event&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where I added a new variable (i.e., indicator) that puts "event" whenever an event occurs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, my questions is that how can I get an&amp;nbsp;output like this:&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; want&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;id&lt;/SPAN&gt; avg_dose time_start time_stop&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;1 15.13 2008-1-17 2008-2-6 
1 13.585 2008-2-7 2008-3-5
1 0 2008-3-6 2008-3-19&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;where "avg_dose" is obtained as the ratio of total cumulative dose between each two events over the total number of days spanned between these two events.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 19:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404084#M3718</guid>
      <dc:creator>Alireza_Boloori</dc:creator>
      <dc:date>2017-10-13T19:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404093#M3719</link>
      <description>&lt;P&gt;Your data structure doesn't lend itself very well to that type of summary, ergo my recommendation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With your approach you'll need a data step and to calculate the averages and such manually - this is prone to error and not very flexible for adding further statistics. If you decide you want the standard deviation and max/min dose that's all a manual calculation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of this with the sample data you provided above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_sample_summary.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15885i5189C8865BB1F575/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_sample_summary.JPG" alt="delete_sample_summary.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 19:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404093#M3719</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-13T19:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404117#M3720</link>
      <description>&lt;P&gt;I don't understand. Why should I merge "episodes" with the second data? What is the purpose of "proc means"?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 20:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404117#M3720</guid>
      <dc:creator>Alireza_Boloori</dc:creator>
      <dc:date>2017-10-13T20:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Average of observations between multiple specific dates</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404161#M3722</link>
      <description>&lt;P&gt;Run it and see.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 21:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Average-of-observations-between-multiple-specific-dates/m-p/404161#M3722</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-13T21:54:00Z</dc:date>
    </item>
  </channel>
</rss>

