<?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: Freq-proportion report in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Freq-proportion-report/m-p/829771#M41103</link>
    <description>&lt;P&gt;What does "finer output" mean for this?&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 22:07:19 GMT</pubDate>
    <dc:creator>HB</dc:creator>
    <dc:date>2022-08-22T22:07:19Z</dc:date>
    <item>
      <title>Freq-proportion report</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Freq-proportion-report/m-p/824288#M40830</link>
      <description>&lt;P&gt;I have the following scenario with two data sets. I have to find the proportion of persons who tested within 5 to 10 days from exposure date. I deduplicated the datasets, merged them then found the diff_date and flagged it as follows. In the end, I found the percentage of date difference in two ways. What I'm trying to do is get a finer output report by using a better syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Exposure;&lt;BR /&gt;input Subject_ID Exp_Date : mmddyy10. Name $14-22 Case_ID Exposure $;&lt;BR /&gt;format exp_date date9.;&lt;BR /&gt;datalines;&lt;BR /&gt;1 12/20/2019 Joe Smith 122 Home&lt;BR /&gt;1 09/30/2019 Joe Smith 435 Home&lt;BR /&gt;2 01/05/2020 Mary Mill 432 Work&lt;BR /&gt;3 11/04/2019 John Doe 129 Work&lt;BR /&gt;3 11/04/2019 John Doe 655 School&lt;BR /&gt;3 01/25/2020 John Doe 721 Work&lt;BR /&gt;;;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data = work.exposure out=exp_nodups nodupkey;&lt;BR /&gt;by Subject_ID Name Exp_date;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data Testing;&lt;BR /&gt;input Subject_ID Test_Date : mmddyy10. Name $14-23;&lt;BR /&gt;format test_date date9.;&lt;BR /&gt;datalines;&lt;BR /&gt;1 12/29/2019 Joe Smith&lt;BR /&gt;2 09/30/2019 Mary Mill&lt;BR /&gt;2 01/07/2020 Mary Mill&lt;BR /&gt;8 06/30/2019 Mark Roger&lt;BR /&gt;8 07/15/2019 Mark Roger&lt;BR /&gt;8 08/29/2019 Mark Roger&lt;BR /&gt;8 12/03/2019 Mark Roger&lt;BR /&gt;;;;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data = work.testing out=test_nodups nodupkey;&lt;BR /&gt;by Subject_ID Name test_date;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data exp_;&lt;BR /&gt;set exp_nodups;&lt;BR /&gt;day5 = exp_date + 5;&lt;BR /&gt;day10 = exp_date + 10;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;Proc SQL;&lt;BR /&gt;Create Table Merge AS&lt;BR /&gt;Select&lt;BR /&gt;coalesce(E.Name, T.Name) as Name,&lt;BR /&gt;E.Exp_Date,E.Case_ID,E.Exposure,day5,day10,&lt;BR /&gt;coalesce(E.Subject_ID, T.Subject_ID) as Subject_ID,&lt;BR /&gt;T.Test_Date&lt;BR /&gt;from exp_ E FULL JOIN test_nodups T on (E.Subject_ID = T.Subject_ID);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data merged;&lt;BR /&gt;set merge;&lt;BR /&gt;dif_days = intck('day', exp_date, test_date);&lt;BR /&gt;flag = day5&amp;lt;=test_date&amp;lt;=day10;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data = merged;&lt;BR /&gt;tables flag/norow nocol out= want;&lt;BR /&gt;title 'Proportion of contacts tested in the 5-10 day window of their quarantine period';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc SQL;&lt;BR /&gt;Create Table proportion AS&lt;BR /&gt;Select&lt;BR /&gt;mean(((dif_days&amp;gt;=5)*(dif_days&amp;lt;=10))) as contact_proportion&lt;BR /&gt;from merged;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 06:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Freq-proportion-report/m-p/824288#M40830</guid>
      <dc:creator>mayasak</dc:creator>
      <dc:date>2022-07-20T06:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Freq-proportion report</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Freq-proportion-report/m-p/829771#M41103</link>
      <description>&lt;P&gt;What does "finer output" mean for this?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 22:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Freq-proportion-report/m-p/829771#M41103</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2022-08-22T22:07:19Z</dc:date>
    </item>
  </channel>
</rss>

