<?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: recoding variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792703#M32669</link>
    <description>&lt;P&gt;Simple math. Add up the zeros and ones, if it is 2 or greater then new variable is 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Percent of 0/1 binary variables that are 1: use PROC SUMMARY and compute the mean of this new variable.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jan 2022 23:07:37 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-01-26T23:07:37Z</dc:date>
    <item>
      <title>Re: recoding variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792699#M32668</link>
      <description>I am trying to create a variable that is dependent on responses to 3 other variables that is grouped under one main category in a survey.&lt;BR /&gt;If the respondent has responded yes ( which is coded as 1) to more than one of the three variables then , then this new variable is coded as 1&lt;BR /&gt;Or in other words the respondent must have responded yes to more than one of the three variables&lt;BR /&gt;Since all the three variables are numeric, I made a new variable in a data step that calculates the sum of these responses to the three variables .&lt;BR /&gt;If the sum is greater than 1 then this new variable is coded as 1 otherwise 0 .&lt;BR /&gt;This is just to determine the percent of this new variable . Just descriptive statistics&lt;BR /&gt;Wondering if anyone has any thoughts?&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 26 Jan 2022 22:38:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792699#M32668</guid>
      <dc:creator>Eric1337</dc:creator>
      <dc:date>2022-01-26T22:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: recoding variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792703#M32669</link>
      <description>&lt;P&gt;Simple math. Add up the zeros and ones, if it is 2 or greater then new variable is 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Percent of 0/1 binary variables that are 1: use PROC SUMMARY and compute the mean of this new variable.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 23:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792703#M32669</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-01-26T23:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: recoding variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792708#M32670</link>
      <description>&lt;P&gt;Recode = ( sum(var1, var2, var3) &amp;gt; 1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS will return 1/0 for true/false of comparisons. If the variables are all numeric coded 1/0 then sum is the number of 1 responses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Caveat: the above will return 0 for the comparison if all the responses are missing. If you require that at least some number of the variables have an answer, such as 2 for example, then perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If n(var1,var2,var3)&amp;gt;2 then Recode = ( sum(var1, var2, var3) &amp;gt; 1);&lt;/P&gt;
&lt;P&gt;Which will only assign a value to Recode when at least two of the variables have values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your variables have a common "root" name you can use short cut lists like&amp;nbsp; sum(of var: ) The : says to use all of the variables whose names start with VAR (caution).&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 23:54:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792708#M32670</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-26T23:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: recoding variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792709#M32671</link>
      <description>Thanks you Paige</description>
      <pubDate>Wed, 26 Jan 2022 23:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Re-recoding-variables/m-p/792709#M32671</guid>
      <dc:creator>Eric1337</dc:creator>
      <dc:date>2022-01-26T23:57:35Z</dc:date>
    </item>
  </channel>
</rss>

