<?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 Median date between two dates in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35472#M1483</link>
    <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I have two variables: startdate and endate. &lt;BR /&gt;
&lt;BR /&gt;
Is there a way to create a new variable called "mediandate" to find the median between the startdate and enddate? &lt;BR /&gt;
&lt;BR /&gt;
So for example, &lt;BR /&gt;
&lt;BR /&gt;
StartDate EndDate MedianDate&lt;BR /&gt;
6/1/10      7/1/10     6/16/10&lt;BR /&gt;
&lt;BR /&gt;
If there is an easier way of doing it without having to do it by hand, that would be great! Any help would be appreciated...&lt;BR /&gt;
&lt;BR /&gt;
-Pauline</description>
    <pubDate>Tue, 15 Jun 2010 02:55:30 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-06-15T02:55:30Z</dc:date>
    <item>
      <title>Median date between two dates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35472#M1483</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I have two variables: startdate and endate. &lt;BR /&gt;
&lt;BR /&gt;
Is there a way to create a new variable called "mediandate" to find the median between the startdate and enddate? &lt;BR /&gt;
&lt;BR /&gt;
So for example, &lt;BR /&gt;
&lt;BR /&gt;
StartDate EndDate MedianDate&lt;BR /&gt;
6/1/10      7/1/10     6/16/10&lt;BR /&gt;
&lt;BR /&gt;
If there is an easier way of doing it without having to do it by hand, that would be great! Any help would be appreciated...&lt;BR /&gt;
&lt;BR /&gt;
-Pauline</description>
      <pubDate>Tue, 15 Jun 2010 02:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35472#M1483</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-15T02:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Median date between two dates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35473#M1484</link>
      <description>[pre]&lt;BR /&gt;
  mediandate = mean(startdate,enddate);&lt;BR /&gt;
  format mediandate mmddyy8.;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 15 Jun 2010 06:09:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35473#M1484</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-06-15T06:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Median date between two dates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35474#M1485</link>
      <description>Hi:&lt;BR /&gt;
  The definition of MEAN and MEDIAN can be found on this page:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#/documentation/cdl/en/proc/61895/HTML/default/a002473332.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#/documentation/cdl/en/proc/61895/HTML/default/a002473332.htm&lt;/A&gt;&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;quote&lt;/I&gt;&lt;BR /&gt;
Mean:&lt;BR /&gt;
The most commonly used parameter is the (arithmetic) mean. If the population contains a finite number of values, then the population mean is computed as the sum of all the values in the population divided by the number of elements in the population. For an infinite population, the concept of the mean is similar but requires more complicated mathematics.&lt;BR /&gt;
&lt;BR /&gt;
Median:&lt;BR /&gt;
The population median is the central value, lying above and below half of the population values. The sample median is the middle value when the data are arranged in ascending or descending order. For an even number of observations, the midpoint between the two middle values is usually reported as the median.&lt;BR /&gt;
&lt;I&gt;endquote&lt;/I&gt;&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
In some data circumstances, the MEAN and MEDIAN would result in the same number, however, it is possible for you to get two different numbers from these statistics.&lt;BR /&gt;
 &lt;BR /&gt;
For example, in SASHELP.SHOES, you might want to compare the MEAN of all SALES with the MEDIAN of all SALES. In this instance, we would use PROC MEANS:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc means data=sashelp.shoes n mean median;&lt;BR /&gt;
  var sales;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                    &lt;BR /&gt;
and the results are:&lt;BR /&gt;
[pre]&lt;BR /&gt;
                             Analysis Variable : Sales Total Sales&lt;BR /&gt;
&lt;BR /&gt;
                                N            Mean          Median&lt;BR /&gt;
                              -----------------------------------&lt;BR /&gt;
                              395        85700.17        38912.00&lt;BR /&gt;
                              -----------------------------------&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
which is very different.&lt;BR /&gt;
 &lt;BR /&gt;
Of course these numbers are calculated across a whole dataset. For rowwise or observation-wise calculations, there are the MEAN and MEDIAN functions, which are documented here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a000245914.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a000245914.htm&lt;/A&gt;&lt;BR /&gt;
and&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a002205763.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#/documentation/cdl/en/lrdict/63026/HTML/default/a002205763.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
Once you understand exactly what you want to do, then you will know which is the right function or procedure to use.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 15 Jun 2010 12:56:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35474#M1485</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-15T12:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Median date between two dates</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35475#M1486</link>
      <description>Thanks Ksharp!! It does the trick.</description>
      <pubDate>Tue, 15 Jun 2010 13:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Median-date-between-two-dates/m-p/35475#M1486</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-15T13:59:46Z</dc:date>
    </item>
  </channel>
</rss>

