<?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: Validate Dataset Linkage by Comparing 2 Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Validate-Dataset-Linkage-by-Comparing-2-Variables/m-p/553816#M154033</link>
    <description>Here's a simple answer to get things started:&lt;BR /&gt;&lt;BR /&gt;PROC freq data=have;&lt;BR /&gt;tables ssn * duplicateid/ noprint out=counts;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;PROC freq data=counts noprint:&lt;BR /&gt;tables ssn / out=ssnlist;&lt;BR /&gt;tables duplicateid/ out=idlist;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data = ssnlist;&lt;BR /&gt;where count &amp;gt; 1;&lt;BR /&gt;var ssn count;&lt;BR /&gt;title 'SSNs having more than 1 ID';&lt;BR /&gt;run;&lt;BR /&gt;proc print data=idlist;&lt;BR /&gt;where count &amp;gt; 1;&lt;BR /&gt;var duplicateid count;&lt;BR /&gt;title 'IDs having more than 1 SSN';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;There's lots of ways to slice and dice the numbers.  This is just a reasonable start.</description>
    <pubDate>Wed, 24 Apr 2019 23:42:54 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-04-24T23:42:54Z</dc:date>
    <item>
      <title>Validate Dataset Linkage by Comparing 2 Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-Dataset-Linkage-by-Comparing-2-Variables/m-p/553778#M154016</link>
      <description>&lt;P&gt;So I'm working with two datasets of patient encounters and I've unduplicated and linked them together. I'd like to now validate my linkage based on social security number. Each observation is structured to have a unique id, a duplicate id, a social security number, and then a bunch of other variables. The unique id is an id for each observation, so a dataset of 100 observations has 100 unique ids, even if a patient has multiple observations. The duplicate id came from using de-duplication software and identifies observations that are likely the same individual, so a dataset of 100 observations might have 50 duplicate ids if each patient had two encounters. And finally social security number is just social security number. Theoretically, if the de-duplication was done correctly every duplicate id would have the same ssn.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data structure:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Uniqueid&amp;nbsp; Duplicateid&amp;nbsp; &amp;nbsp;SSN&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 123&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 456&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 456&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 789&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 432&lt;/P&gt;&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 432&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So there are 6 encounters here, my de-duplication software identified 4 different patients, and each observation has a SSN. So I'd like to get a percentage of: does every duplicate id with value of "2" have the same value for SSN. This would be as opposed to duplicate id "3" which has two different SSN, indicating that the linkage software made an incorrect link, or duplicate id "3" and "4" which the de-duplication software identified as two different patients but they actually are the same person with same SSN.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate the help!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 19:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-Dataset-Linkage-by-Comparing-2-Variables/m-p/553778#M154016</guid>
      <dc:creator>sasuser22</dc:creator>
      <dc:date>2019-04-24T19:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Validate Dataset Linkage by Comparing 2 Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Validate-Dataset-Linkage-by-Comparing-2-Variables/m-p/553816#M154033</link>
      <description>Here's a simple answer to get things started:&lt;BR /&gt;&lt;BR /&gt;PROC freq data=have;&lt;BR /&gt;tables ssn * duplicateid/ noprint out=counts;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;PROC freq data=counts noprint:&lt;BR /&gt;tables ssn / out=ssnlist;&lt;BR /&gt;tables duplicateid/ out=idlist;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data = ssnlist;&lt;BR /&gt;where count &amp;gt; 1;&lt;BR /&gt;var ssn count;&lt;BR /&gt;title 'SSNs having more than 1 ID';&lt;BR /&gt;run;&lt;BR /&gt;proc print data=idlist;&lt;BR /&gt;where count &amp;gt; 1;&lt;BR /&gt;var duplicateid count;&lt;BR /&gt;title 'IDs having more than 1 SSN';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;There's lots of ways to slice and dice the numbers.  This is just a reasonable start.</description>
      <pubDate>Wed, 24 Apr 2019 23:42:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Validate-Dataset-Linkage-by-Comparing-2-Variables/m-p/553816#M154033</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-04-24T23:42:54Z</dc:date>
    </item>
  </channel>
</rss>

