<?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 recode continuous variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-continuous-variables/m-p/518560#M140366</link>
    <description>&lt;P&gt;I have 15 continuous variables and the data entry person defined "888" and "999" as missing. I don;t want these two numbers to be calculated in the proc means procedure as they appeared to be the maximum values. Is there a way to recode 888 and 999 as . ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please coach me how to do the data cleaning step in the data step? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the data and below are the variables I was using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro one(x) (where=(wrat_raw not in (888 999)));&lt;BR /&gt;proc means n mean std median min max maxdec=1;&lt;BR /&gt;var &amp;amp;x;&lt;BR /&gt;class site_id Phase visit_id;&lt;BR /&gt;run;&lt;BR /&gt;%mend one;&lt;BR /&gt;%one (wrat_raw);&lt;BR /&gt;%one (wrat_ss);&lt;BR /&gt;%one (wrat_perc);&lt;/P&gt;&lt;P&gt;%one (bacs_symbol_raw);&lt;BR /&gt;%one (bacs_standardized);&lt;BR /&gt;%one (bacs_percentile);&lt;/P&gt;&lt;P&gt;%one (hvlt_trial1);&lt;BR /&gt;%one (hvlt_trial2);&lt;BR /&gt;%one (hvlt_trial3);&lt;BR /&gt;%one (hvlttot);&lt;BR /&gt;%one (hvlt_standardized);&lt;BR /&gt;%one (hvlt_percentile);&lt;/P&gt;&lt;P&gt;%one (msceit_raw);&lt;BR /&gt;%one (msceit);&lt;BR /&gt;%one (msceitpercentile);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Dec 2018 20:20:02 GMT</pubDate>
    <dc:creator>Denali</dc:creator>
    <dc:date>2018-12-04T20:20:02Z</dc:date>
    <item>
      <title>How to recode continuous variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-continuous-variables/m-p/518560#M140366</link>
      <description>&lt;P&gt;I have 15 continuous variables and the data entry person defined "888" and "999" as missing. I don;t want these two numbers to be calculated in the proc means procedure as they appeared to be the maximum values. Is there a way to recode 888 and 999 as . ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please coach me how to do the data cleaning step in the data step? Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is the data and below are the variables I was using.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro one(x) (where=(wrat_raw not in (888 999)));&lt;BR /&gt;proc means n mean std median min max maxdec=1;&lt;BR /&gt;var &amp;amp;x;&lt;BR /&gt;class site_id Phase visit_id;&lt;BR /&gt;run;&lt;BR /&gt;%mend one;&lt;BR /&gt;%one (wrat_raw);&lt;BR /&gt;%one (wrat_ss);&lt;BR /&gt;%one (wrat_perc);&lt;/P&gt;&lt;P&gt;%one (bacs_symbol_raw);&lt;BR /&gt;%one (bacs_standardized);&lt;BR /&gt;%one (bacs_percentile);&lt;/P&gt;&lt;P&gt;%one (hvlt_trial1);&lt;BR /&gt;%one (hvlt_trial2);&lt;BR /&gt;%one (hvlt_trial3);&lt;BR /&gt;%one (hvlttot);&lt;BR /&gt;%one (hvlt_standardized);&lt;BR /&gt;%one (hvlt_percentile);&lt;/P&gt;&lt;P&gt;%one (msceit_raw);&lt;BR /&gt;%one (msceit);&lt;BR /&gt;%one (msceitpercentile);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 20:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-continuous-variables/m-p/518560#M140366</guid>
      <dc:creator>Denali</dc:creator>
      <dc:date>2018-12-04T20:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to recode continuous variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-recode-continuous-variables/m-p/518575#M140372</link>
      <description>&lt;P&gt;You can recode them in a DATA step easily enough.&amp;nbsp; But I would suggest using special missing values, rather than . so here is an example using 3 variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;array nums {*} wrat_raw wrat_ss wrat_perc;&lt;/P&gt;
&lt;P&gt;do k=1 to dim(nums);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if nums{k} = 888 then nums{k} = .A;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;else if nums{k}= 999 then nums{k} = .B;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;drop k;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The special missing values will automatically be excluded from PROC MEANS calculations.&amp;nbsp; But you still have a record of what the value used to be, if that ever becomes important to know.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 20:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-recode-continuous-variables/m-p/518575#M140372</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-04T20:51:27Z</dc:date>
    </item>
  </channel>
</rss>

