<?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: How do I do this? Please help - newbie user in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114502#M31671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; As I understand survays2 has 11 variables and 343 observations, the first 10 variables have numeric values within (1, 2, 3, 4, 5, 8), (I assume 8 implies the person (observation) didn't answer atall). The last variable is the year. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Q: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;How many ppl answered three in total or in 2010 for each question and overall.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am tying to make sense of this question; are you asking how many people answered question the in 2010, and answered question 3 in all time?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If so here is the answer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* how did people answer question 3 in 2010&amp;gt; */&lt;/P&gt;&lt;P&gt;proc freq data=survay2(where=(year=2010));&lt;/P&gt;&lt;P&gt;tables q3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* how did people answer question 3 in over all years? */&lt;/P&gt;&lt;P&gt;proc freq data=survay2;&lt;/P&gt;&lt;P&gt;tables q3*year;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This should give you a cross-tabulation that provides a yearly breakdown of people's answers. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 18 Aug 2013 20:24:50 GMT</pubDate>
    <dc:creator>Murray_Court</dc:creator>
    <dc:date>2013-08-18T20:24:50Z</dc:date>
    <item>
      <title>How do I do this? Please help - newbie user</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114499#M31668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use SAS 9.3 here and there for work stuff, I know some of the basics but I'm drawing a blank trying to figure out 2 things. Was really hoping for some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I have variable of just numbers from 0-100. I'd like to tell SAS to group them into 3 groups (0, 1-10, and 10+) so I can analyze using those three groups. How can I do this? I know it's probably something simple but I'm drawing a blank...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) I have 10 variables, each with numbers varying from 1-5. I want to tell SAS to give me all the answers that were "1" or "2" or "3" overall and by year...how can I do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything else I need I was able to figure out one way or another except those...any help would be so appreciated. Thanks. I hope I was clear enough...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 16:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114499#M31668</guid>
      <dc:creator>nikknock</dc:creator>
      <dc:date>2013-08-18T16:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do this? Please help - newbie user</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114500#M31669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;/*assign group number based on numeric value*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data answer1;&lt;/P&gt;&lt;P&gt;set one;&lt;/P&gt;&lt;P&gt;if number_var =0 then group_no=1;&lt;/P&gt;&lt;P&gt;else if number_var le 10 then group_no=2;&lt;/P&gt;&lt;P&gt;else group_no=3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*sample frequency analysis*/&lt;/P&gt;&lt;P&gt;proc freq data=answer1;&lt;/P&gt;&lt;P&gt;tables group_no;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*simple subsetting of numeric variable. */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data answer2;&lt;/P&gt;&lt;P&gt;set two;&lt;/P&gt;&lt;P&gt;where number_var in (1,2,3);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*print new dataset, year information should have been kept from original dataset,*/&lt;/P&gt;&lt;P&gt;proc print data=answer2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 17:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114500#M31669</guid>
      <dc:creator>Murray_Court</dc:creator>
      <dc:date>2013-08-18T17:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do this? Please help - newbie user</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114501#M31670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First one I got down perfect thanks to you. THANK YOU!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still need a little bit of help on the second. I might not have been clear enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset called surveys2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within that dataset I have 10 variables, each a separate question. (the variables are named q1 q2 q3 ...q10).&lt;/P&gt;&lt;P&gt;Each questions has a 343 rows, in each row is a number 1-5 or 8 (people's answer to the question)&lt;/P&gt;&lt;P&gt;I want to sum up all the answers of 1, 2, 3, 4 ,5 or 8 separately and break them out by year.&lt;/P&gt;&lt;P&gt;For eg: How many ppl answered three in total or in 2010 for each question and overall.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do that? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 18:36:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114501#M31670</guid>
      <dc:creator>nikknock</dc:creator>
      <dc:date>2013-08-18T18:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do this? Please help - newbie user</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114502#M31671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; As I understand survays2 has 11 variables and 343 observations, the first 10 variables have numeric values within (1, 2, 3, 4, 5, 8), (I assume 8 implies the person (observation) didn't answer atall). The last variable is the year. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Q: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;How many ppl answered three in total or in 2010 for each question and overall.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am tying to make sense of this question; are you asking how many people answered question the in 2010, and answered question 3 in all time?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; If so here is the answer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* how did people answer question 3 in 2010&amp;gt; */&lt;/P&gt;&lt;P&gt;proc freq data=survay2(where=(year=2010));&lt;/P&gt;&lt;P&gt;tables q3;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* how did people answer question 3 in over all years? */&lt;/P&gt;&lt;P&gt;proc freq data=survay2;&lt;/P&gt;&lt;P&gt;tables q3*year;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; This should give you a cross-tabulation that provides a yearly breakdown of people's answers. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 20:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114502#M31671</guid>
      <dc:creator>Murray_Court</dc:creator>
      <dc:date>2013-08-18T20:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do this? Please help - newbie user</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114503#M31672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your data format to the following structure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Person Question Year Response&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use proc transpose to change the data format.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm" title="http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm"&gt;SAS Learning Module: How to reshape data wide to long using proc transpose&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use Proc Freq to analyze your data easily. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EG.&lt;/P&gt;&lt;P&gt;proc freq data=have;&lt;/P&gt;&lt;P&gt;table year*response/out=summary1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 21:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114503#M31672</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-08-18T21:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do this? Please help - newbie user</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114504#M31673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use one of the CAT functions to count how many responses were 1,2,3,4,5 or 8 in each row. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data sum_response ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set survey2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count1 = countc(catt(of q1-q10), '1');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count2 = countc(catt(of q1-q10), '2');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc . . .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count8 = countc(catt(of q1-q10), '8');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Aug 2013 21:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114504#M31673</guid>
      <dc:creator>Fugue</dc:creator>
      <dc:date>2013-08-18T21:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I do this? Please help - newbie user</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114505#M31674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;1) I have variable of just numbers from 0-100. I'd like to tell SAS to group them into 3 groups (0, 1-10, and 10+) so I can analyze using those three groups. How can I do this? I know it's probably something simple but I'm drawing a blank...&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Another way to analyze things in groups without having to add anything to your data is custom formats.&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc format library=work;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value mygroup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 = ' 0'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 - 10 = ' 1 to 10'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11-100='11 to 100'&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 freq data= yourdatasetname;&lt;/P&gt;&lt;P&gt;tables yourvariablename;&lt;/P&gt;&lt;P&gt;format yourvariablename mygroup. ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The text assosiated with the format can be pretty much what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2013 15:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-do-this-Please-help-newbie-user/m-p/114505#M31674</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-08-19T15:15:20Z</dc:date>
    </item>
  </channel>
</rss>

