<?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: Create ID/Strata variable for matched case-control in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-ID-Strata-variable-for-matched-case-control/m-p/635953#M21340</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input case_PtID control_PtID;
datalines;
97654 23345
97654 34967
97654 54244
97654 87442
11111 84354
11111 39760
11111 13012
11111 93423
;

data want;
   set have;
   by case_PtID notsorted;
   if first.case_PtID then id = sum (id, 1);
   retain id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Mar 2020 19:48:18 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-03-30T19:48:18Z</dc:date>
    <item>
      <title>Create ID/Strata variable for matched case-control</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-ID-Strata-variable-for-matched-case-control/m-p/635950#M21339</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking to perform case-control matched analysis.&amp;nbsp; Currently, I have my data in one dataset with 1 case PtID to 4 control PtIDs and am looking for help to create the ID/ Strata variable for use with analysis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How my data is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case_PtID 	control_PtID	
97654		23345
97654		34967
97654		54244
97654		87442
11111		84354
11111		39760
11111		13012
11111		93423&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How I want my data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case_PtID 	control_PtID	id
97654		23345		    1
97654		34967		    1
97654		54244		    1
97654		87442		    1
11111		84354		    2
11111		39760		    2
11111		13012		    2
11111		93423		    2&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Mar 2020 19:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-ID-Strata-variable-for-matched-case-control/m-p/635950#M21339</guid>
      <dc:creator>bel2806</dc:creator>
      <dc:date>2020-03-30T19:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create ID/Strata variable for matched case-control</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-ID-Strata-variable-for-matched-case-control/m-p/635953#M21340</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input case_PtID control_PtID;
datalines;
97654 23345
97654 34967
97654 54244
97654 87442
11111 84354
11111 39760
11111 13012
11111 93423
;

data want;
   set have;
   by case_PtID notsorted;
   if first.case_PtID then id = sum (id, 1);
   retain id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Mar 2020 19:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-ID-Strata-variable-for-matched-case-control/m-p/635953#M21340</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-03-30T19:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create ID/Strata variable for matched case-control</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-ID-Strata-variable-for-matched-case-control/m-p/639836#M21714</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;this worked well, thank you!&amp;nbsp; Do you know how to use this strata variable in PROC MIXED?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 16:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-ID-Strata-variable-for-matched-case-control/m-p/639836#M21714</guid>
      <dc:creator>bel2806</dc:creator>
      <dc:date>2020-04-14T16:45:49Z</dc:date>
    </item>
  </channel>
</rss>

