<?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: Case control matching in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Case-control-matching/m-p/801944#M315655</link>
    <description>&lt;P&gt;If you want to remove duplicate controls then could you try adding the distinct option in the select statement in your proc sql code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, if you want 2 controls per case, you could try proc surveyselect, something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveyselect data=controls_id method=srs sampsize=2;&lt;/P&gt;&lt;P&gt;strata case_id;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2022 14:46:32 GMT</pubDate>
    <dc:creator>benjamin_2018</dc:creator>
    <dc:date>2022-03-14T14:46:32Z</dc:date>
    <item>
      <title>Case control matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-control-matching/m-p/801720#M315538</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset with 87 cases and 1000's of controls. I want to match 2:1 with out replacement for the controls. I want to match on year of procedure (+/- 2 years), diagnosis (which can have 6 different values) and sex. I have searched through many papers online which did not remove duplicate controls.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kjmathes03_0-1647023595230.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69405i1ECF8FF225E5D89C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kjmathes03_0-1647023595230.png" alt="kjmathes03_0-1647023595230.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kjmathes03_1-1647023642058.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69406i57FFA666A7C1CFBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kjmathes03_1-1647023642058.png" alt="kjmathes03_1-1647023642058.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As well as the above paper which also did not remove duplicates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying the following code&lt;/P&gt;&lt;P&gt;DATA cases controls;&lt;BR /&gt;SET cohort3;&lt;BR /&gt;IF fvii_inclusion = 1 THEN OUTPUT cases;&lt;BR /&gt;ELSE OUTPUT controls;&lt;BR /&gt;RUN;&lt;BR /&gt;data control2;&lt;BR /&gt;set controls;&lt;BR /&gt;time_low=timet-2;&lt;BR /&gt;time_high=timet+2;&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table controls_id&lt;BR /&gt;as select&lt;BR /&gt;one.uniqueid as case_id,&lt;BR /&gt;two.uniqueid as control_id,&lt;BR /&gt;one.timet as case_time,&lt;BR /&gt;two.timet as control_time ,&lt;BR /&gt;one.proc as case_proc,&lt;BR /&gt;two.proc as control_proc,&lt;BR /&gt;one.sex as case_sex,&lt;BR /&gt;two.sex as control_sex,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;from cases one, control2 two&lt;BR /&gt;where ((one.timet between two.time_low and two.time_high) and (one.sex=two.sex) and one.proc=two.proc) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also reviewed the suggestions on hash tags for a similar problem posted but it changed nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HELP much appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 18:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-control-matching/m-p/801720#M315538</guid>
      <dc:creator>kjmathes03</dc:creator>
      <dc:date>2022-03-11T18:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Case control matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Case-control-matching/m-p/801944#M315655</link>
      <description>&lt;P&gt;If you want to remove duplicate controls then could you try adding the distinct option in the select statement in your proc sql code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, if you want 2 controls per case, you could try proc surveyselect, something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc surveyselect data=controls_id method=srs sampsize=2;&lt;/P&gt;&lt;P&gt;strata case_id;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 14:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Case-control-matching/m-p/801944#M315655</guid>
      <dc:creator>benjamin_2018</dc:creator>
      <dc:date>2022-03-14T14:46:32Z</dc:date>
    </item>
  </channel>
</rss>

