<?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: matching case-control in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/matching-case-control/m-p/291030#M60287</link>
    <description>&lt;P&gt;"This seemed to work" but it clearly doesn't. Therefore, your problem must be different from the one posted in 2012.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post this question as a new topic with your description of the case-control matching rules and some test data.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2016 17:53:23 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2016-08-11T17:53:23Z</dc:date>
    <item>
      <title>matching case-control</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matching-case-control/m-p/291027#M60286</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Hi!&amp;nbsp; I recently used some syntax you created for a match sase- control table for a question posted in 2012:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/forums/replypage/board-id/programming/message-id/22601" target="_blank"&gt;https://communities.sas.com/t5/forums/replypage/board-id/programming/message-id/22601&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This seemed to work but I need some help troubleshooting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; The control id (ne_ssn) is duplicating and being used more than once.&amp;nbsp; I want to be matched only once to a case (e_ssn).&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Some cases are matched to over 200+ controls.&amp;nbsp; I want to limit it to 5 matches.&lt;/P&gt;
&lt;P&gt;3. I seems some of my cases are not appearing at all in my final table (e.g. 620K cases but final table only matched 600K cases).&amp;nbsp; Does this mean there are no matches at all for the missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is much apprecited!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my syntax:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc sort data=tmp;&lt;BR /&gt;by service_entry_date study rand_num;&lt;BR /&gt;run;&lt;BR /&gt;* 'study' variable is 1=case 0=control;&lt;BR /&gt;&lt;BR /&gt;proc rank data=tmp out=tempR;&lt;BR /&gt;by service_entry_date study;&lt;BR /&gt;var rand_num;&lt;BR /&gt;run;&lt;BR /&gt;*assign random order;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table exp2.match as&lt;BR /&gt;select a.ssn as e_ssn, a.service_branch as e_service_branch, a.sex as e_sex, a.service_entry_date as e_service_entry_date, a.study,&lt;BR /&gt;b.ssn as ne_ssn, b.service_branch as ne_service_branch, b.sex as ne_sex, b.service_entry_date as ne_service_entry_date, b.study&lt;BR /&gt;from tempr as a inner join tempr as b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on( a.service_entry_date between b.service_entry_date and b.service_entry_date_low) and a.service_branch=b.service_branch and &lt;BR /&gt;a.sex=b.sex and a.rand_num=ceil(b.rand_num/5)&lt;BR /&gt;where a.study and not b.study;&lt;BR /&gt;drop table tmp, tmpR;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 17:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matching-case-control/m-p/291027#M60286</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2016-08-11T17:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: matching case-control</title>
      <link>https://communities.sas.com/t5/SAS-Programming/matching-case-control/m-p/291030#M60287</link>
      <description>&lt;P&gt;"This seemed to work" but it clearly doesn't. Therefore, your problem must be different from the one posted in 2012.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post this question as a new topic with your description of the case-control matching rules and some test data.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 17:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/matching-case-control/m-p/291030#M60287</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-11T17:53:23Z</dc:date>
    </item>
  </channel>
</rss>

