<?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 Calculating the mean of duration where output keeps time format in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Calculating-the-mean-of-duration-where-output-keeps-time-format/m-p/563114#M10842</link>
    <description>&lt;P&gt;I am trying to figure out if a new procedure change implemented between year 1 and year 2 has caused a delay in the procedure being administered. I have a procedure start time and procedure end time which are both time. formatted, and subtracted the difference to create a variable = duration between start and finish times (which is also formatted as a time).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to find the average of these durations, but proc means does not maintain the time format. I have searched several threads and tried many of their suggestions but have not yet found a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried doing an output= option with proc means, but I'm not sure this is exactly what I need because ideally I would like to be able to calculate different averages of duration based on other different variables/strata in addition to year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
    <pubDate>Sun, 02 Jun 2019 04:32:16 GMT</pubDate>
    <dc:creator>leam3</dc:creator>
    <dc:date>2019-06-02T04:32:16Z</dc:date>
    <item>
      <title>Calculating the mean of duration where output keeps time format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Calculating-the-mean-of-duration-where-output-keeps-time-format/m-p/563114#M10842</link>
      <description>&lt;P&gt;I am trying to figure out if a new procedure change implemented between year 1 and year 2 has caused a delay in the procedure being administered. I have a procedure start time and procedure end time which are both time. formatted, and subtracted the difference to create a variable = duration between start and finish times (which is also formatted as a time).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to find the average of these durations, but proc means does not maintain the time format. I have searched several threads and tried many of their suggestions but have not yet found a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried doing an output= option with proc means, but I'm not sure this is exactly what I need because ideally I would like to be able to calculate different averages of duration based on other different variables/strata in addition to year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jun 2019 04:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Calculating-the-mean-of-duration-where-output-keeps-time-format/m-p/563114#M10842</guid>
      <dc:creator>leam3</dc:creator>
      <dc:date>2019-06-02T04:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the mean of duration where output keeps time format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Calculating-the-mean-of-duration-where-output-keeps-time-format/m-p/563132#M10851</link>
      <description>You have started out correctly.  But PROC MEANS does not let you format statistics in the output data set.  The simplest solution is to add a step to apply a TIME format, just as you did with your calculated durations.  If your data set is huge, we can explore ways that are faster yet more complex.</description>
      <pubDate>Sun, 02 Jun 2019 13:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Calculating-the-mean-of-duration-where-output-keeps-time-format/m-p/563132#M10851</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-06-02T13:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the mean of duration where output keeps time format</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Calculating-the-mean-of-duration-where-output-keeps-time-format/m-p/563288#M10876</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/276309"&gt;@leam3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to figure out if a new procedure change implemented between year 1 and year 2 has caused a delay in the procedure being administered. I have a procedure start time and procedure end time which are both time. formatted, and subtracted the difference to create a variable = duration between start and finish times (which is also formatted as a time).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to find the average of these durations, but proc means does not maintain the time format. I have searched several threads and tried many of their suggestions but have not yet found a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried doing an output= option with proc means, but I'm not sure this is exactly what I need because ideally I would like to be able to calculate different averages of duration based on other different variables/strata in addition to year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Proc Means, and its cousin Proc Summary, will allow you do get summaries by multiple strata with a single pass through&amp;nbsp; the data.&lt;/P&gt;
&lt;P&gt;Place all of the strata variables, including year, in a CLASS statement.&lt;/P&gt;
&lt;P&gt;The output data set, which you will want, will have a variable _type_ that indicates the combination of strata variables involved for any summary row. _TYPE_=0 is overall, i.e. not stratified and _TYPE_ = 2**n - 1, where n= number of class variables, it the combination of all of the strata. By selecting the correct _type_ you can examine any desired combination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assign the appropriate format to the statistics in a following data step or Report procedure syntax.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 15:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Calculating-the-mean-of-duration-where-output-keeps-time-format/m-p/563288#M10876</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-03T15:15:50Z</dc:date>
    </item>
  </channel>
</rss>

