<?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 Creating new variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266883#M269322</link>
    <description>&lt;P&gt;I am trying to a&lt;SPAN&gt;dd four variables to create a score for each person and then create a new variable that has two categories: Engaged (&amp;gt;1 score) and not engaged (&amp;lt;=1). How would I go bout this or does anyone recommend a website or book to look at?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2016 00:38:12 GMT</pubDate>
    <dc:creator>apatter3</dc:creator>
    <dc:date>2016-04-28T00:38:12Z</dc:date>
    <item>
      <title>Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266883#M269322</link>
      <description>&lt;P&gt;I am trying to a&lt;SPAN&gt;dd four variables to create a score for each person and then create a new variable that has two categories: Engaged (&amp;gt;1 score) and not engaged (&amp;lt;=1). How would I go bout this or does anyone recommend a website or book to look at?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 00:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266883#M269322</guid>
      <dc:creator>apatter3</dc:creator>
      <dc:date>2016-04-28T00:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266884#M269323</link>
      <description>&lt;P&gt;Without knowing anything about your data or the rules you're trying to implement all we can kind of do is point you towards a tutorial.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/vars.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/modules/vars.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, it's good to post what you have and what you want, we can help with the getting from A to B &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 00:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266884#M269323</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-28T00:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266886#M269324</link>
      <description>&lt;P&gt;I am looking at engagement in regards to returning ASQs. I have ASQ2, ASQ4, ASQ8, and ASQ12. I want to a&lt;SPAN&gt;dd the ASQs to create a score for each person and then create a new variable that has two categories: Engagement (&amp;gt;1 score) and not engaged (&amp;lt;=1).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;IF _2_MONTH_ASQ='Yes' THEN ASQ2=1;&lt;/DIV&gt;&lt;DIV&gt;ELSE IF _2_MONTH_ASQ='No' THEN ASQ2=0;&lt;/DIV&gt;&lt;DIV&gt;ELSE ASQ2=.;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;IF _4_MONTH_ASQ='Yes' THEN ASQ4=1;&lt;/DIV&gt;&lt;DIV&gt;ELSE IF _4_MONTH_ASQ='No' THEN ASQ4=0;&lt;/DIV&gt;&lt;DIV&gt;ELSE ASQ4=.;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;IF _8_MONTH_ASQ='Yes' THEN ASQ8=1;&lt;/DIV&gt;&lt;DIV&gt;ELSE IF _8_MONTH_ASQ='No' THEN ASQ8=0;&lt;/DIV&gt;&lt;DIV&gt;ELSE ASQ8=.;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;IF _12_MONTH_ASQ='Yes' THEN ASQ12=1;&lt;/DIV&gt;&lt;DIV&gt;ELSE IF _12_MONTH_ASQ='No' THEN ASQ12=0;&lt;/DIV&gt;&lt;DIV&gt;ELSE ASQ12=.;&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 Apr 2016 01:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266886#M269324</guid>
      <dc:creator>apatter3</dc:creator>
      <dc:date>2016-04-28T01:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266888#M269325</link>
      <description>&lt;P&gt;Once you have the ASQs variable created as per your previous post. Please use the sum funtion as below to get the sum of the ASQs to create a score variable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;scoren=sum(of ASQ2-ASQ12);
if scoren&amp;gt;1 then score='&amp;gt;1 ';
else if scoren&amp;lt;=1 then score='&amp;lt;=1';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 01:32:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266888#M269325</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2016-04-28T01:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating new variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266895#M269326</link>
      <description>&lt;P&gt;You could &amp;nbsp;create your score directly from the&amp;nbsp;&lt;SPAN&gt;_2_MONTH_ASQ etc. variables. But assuming you need the ASQ2 etc. variables for some other purpose, your score could be&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if sum(ASQ2, ASQ4, ASQ8, ASQ12) &amp;lt;= 1
	then score = "Not engaged";
	else score = "Engagement";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Note that if all ASQ2 etc. variables are missing, the score will be Not engaged.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2016 02:50:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-new-variables/m-p/266895#M269326</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-04-28T02:50:44Z</dc:date>
    </item>
  </channel>
</rss>

