<?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 How to categorize variable in one dataset based on range reference in another dataset? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-categorize-variable-in-one-dataset-based-on-range/m-p/181734#M46290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I came across this question in my working project. It does not seem to be a difficult task, but I just can not figure it out after spending the whole night, sigh....:smileyconfused:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;There are two datasets, one contains patients ID and one continuous biomarker variable x, the other dataset provides the reference range of this biomarker x (lowref_x and highref_x) and corresponded disease severity score for each range of x. Since there is no common variable between the two datasets I have to come up with some coding to generate the disease severity score for each patient ID based on his marker value in dataset one and reference range in dataset two. Can anyone help me out on this? I really appreciate it!!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2014 02:29:48 GMT</pubDate>
    <dc:creator>sascool</dc:creator>
    <dc:date>2014-06-03T02:29:48Z</dc:date>
    <item>
      <title>How to categorize variable in one dataset based on range reference in another dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-categorize-variable-in-one-dataset-based-on-range/m-p/181734#M46290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I came across this question in my working project. It does not seem to be a difficult task, but I just can not figure it out after spending the whole night, sigh....:smileyconfused:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;There are two datasets, one contains patients ID and one continuous biomarker variable x, the other dataset provides the reference range of this biomarker x (lowref_x and highref_x) and corresponded disease severity score for each range of x. Since there is no common variable between the two datasets I have to come up with some coding to generate the disease severity score for each patient ID based on his marker value in dataset one and reference range in dataset two. Can anyone help me out on this? I really appreciate it!!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 02:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-categorize-variable-in-one-dataset-based-on-range/m-p/181734#M46290</guid>
      <dc:creator>sascool</dc:creator>
      <dc:date>2014-06-03T02:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize variable in one dataset based on range reference in another dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-categorize-variable-in-one-dataset-based-on-range/m-p/181735#M46291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way is to calculate range in both datasets and use this variable as a common variable to combine them. Provided that there is an exact relationship between ranges in both datasets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naeem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table a as&lt;BR /&gt;select id,range(x) as r from one&lt;BR /&gt;group by id;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data b;&lt;BR /&gt;set two;&lt;BR /&gt;r=highref_x-lowref_x;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select a.id,a.r,b.severity from a&lt;BR /&gt;inner join b&lt;BR /&gt;on a.r=b.r;&lt;BR /&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 02:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-categorize-variable-in-one-dataset-based-on-range/m-p/181735#M46291</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2014-06-03T02:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to categorize variable in one dataset based on range reference in another dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-categorize-variable-in-one-dataset-based-on-range/m-p/181736#M46292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another could be to use the reference data to create custom formats then use the appropriate format for any print or report procedures.&lt;/P&gt;&lt;P&gt;The specifics on using a data set to create a format are in reference for Proc Format and the CNTLIN option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A manual example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;value marker&lt;/P&gt;&lt;P&gt;1 - 10 = 'Low'&lt;/P&gt;&lt;P&gt;10&amp;lt;-20 = 'Medium'&lt;/P&gt;&lt;P&gt;20&amp;lt;-high= 'High';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input id x;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1 4.5&lt;/P&gt;&lt;P&gt;2 11.7&lt;/P&gt;&lt;P&gt;3 205.6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=test noobs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var id x;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format x marker.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 15:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-categorize-variable-in-one-dataset-based-on-range/m-p/181736#M46292</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-06-03T15:31:38Z</dc:date>
    </item>
  </channel>
</rss>

