<?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: Combining SAS variable responses into one variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585968#M14424</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/169154"&gt;@jessho&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The if then statements did not work for me, but this proc format command initially did.&amp;nbsp; However, then when I went to run a regression on the model, it reverted back to the prior separate labels in my logistic regression output.&amp;nbsp; Is there a command that would change the response labels permanently?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to use the Format in the proc logistic.&lt;/P&gt;
&lt;P&gt;If you want to permanently assign the format you can do that manually (not recommended but you can) using the tableview or the SAS Exporere display columns. Or Proc Datasets (recommended for existing data sets). Or rerun a data step with the format assignment.&lt;/P&gt;
&lt;P&gt;Or just remember to use the format in the other procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm pretty leery about permanently assigning such formats as I might accidently forget that is a formatted value if I don't use the data set for awhile and wonder why it doesn't match the collection documents.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2019 22:24:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-09-03T22:24:17Z</dc:date>
    <item>
      <title>Combining SAS variable responses into one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585886#M14398</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one variable, patientfeedbackresponse, in my dataset.&amp;nbsp; I wanted to combine two categories of character variable responses into one (trying to combine 'Retail health clinic' and 'Urgent care center' into a new joint category called 'OSH clinic').&amp;nbsp; Each time, I try to relabel into a joint variable, I one of the categories comes up as missing.&amp;nbsp; How would you recommend doing this?&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;patientfeedbackresponse Frequency Percent CumulativeFrequency CumulativePercent &lt;TABLE cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Done nothing&lt;/TD&gt;&lt;TD&gt;7633&lt;/TD&gt;&lt;TD&gt;39.61&lt;/TD&gt;&lt;TD&gt;10995&lt;/TD&gt;&lt;TD&gt;57.06&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Emergency room&lt;/TD&gt;&lt;TD&gt;206&lt;/TD&gt;&lt;TD&gt;1.07&lt;/TD&gt;&lt;TD&gt;11201&lt;/TD&gt;&lt;TD&gt;58.13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;N/A&lt;/TD&gt;&lt;TD&gt;7019&lt;/TD&gt;&lt;TD&gt;36.42&lt;/TD&gt;&lt;TD&gt;18220&lt;/TD&gt;&lt;TD&gt;94.55&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Retail health clinic&lt;/TD&gt;&lt;TD&gt;270&lt;/TD&gt;&lt;TD&gt;1.40&lt;/TD&gt;&lt;TD&gt;18490&lt;/TD&gt;&lt;TD&gt;95.95&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Urgent care center&lt;/TD&gt;&lt;TD&gt;780&lt;/TD&gt;&lt;TD&gt;4.05&lt;/TD&gt;&lt;TD&gt;19270&lt;/TD&gt;&lt;TD&gt;100.00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 17:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585886#M14398</guid>
      <dc:creator>jessho</dc:creator>
      <dc:date>2019-09-03T17:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Combining SAS variable responses into one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585887#M14399</link>
      <description>Use an IF/THEN statement within a data step prior to the PROC FREQ to recode the variable. &lt;BR /&gt;&lt;BR /&gt;Or use a custom format and apply that to the data using PROC FREQ. This option provides more flexibility in the long run.</description>
      <pubDate>Tue, 03 Sep 2019 17:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585887#M14399</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-03T17:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Combining SAS variable responses into one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585929#M14412</link>
      <description>&lt;P&gt;An example of &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;'s custom format approach.&lt;/P&gt;
&lt;PRE&gt;proc format library=work;
value $mylist
"Retail health clinic","Urgent care center"="OSH clinic"
;
run;

proc freq data=have;
   tables patientfeedbackresponse;
   format patientfeedbackresponse $mylist.;
run;&lt;/PRE&gt;
&lt;P&gt;This format takes advantage of only formatting the values specified. Anything else not used will appear with the current text.&lt;/P&gt;
&lt;P&gt;Of course I don't have your data set name, so use yours on the proc freq statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Formats used this way create groups as needed. So you could have other formats that combined Emergency room plus these two clinics to a "Any service provider" versus the None and N/A.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 19:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585929#M14412</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-03T19:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Combining SAS variable responses into one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585943#M14414</link>
      <description>&lt;P&gt;The if then statements did not work for me, but this proc format command initially did.&amp;nbsp; However, then when I went to run a regression on the model, it reverted back to the prior separate labels in my logistic regression output.&amp;nbsp; Is there a command that would change the response labels permanently?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 20:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585943#M14414</guid>
      <dc:creator>jessho</dc:creator>
      <dc:date>2019-09-03T20:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Combining SAS variable responses into one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585963#M14422</link>
      <description>&lt;P&gt;The methods both work, so you likely did something incorrect somewhere or didn't specify the correct option. If you post the code we can show you where that was. Perhaps you simply forgot to apply the label to the data set for the regression?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have a format, you can convert it using PUT() but if IF/THEN didn't work, the PUT() conversion won't work either because both are essentially the same approach - recoding the variable. Show your work please.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/169154"&gt;@jessho&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The if then statements did not work for me, but this proc format command initially did.&amp;nbsp; However, then when I went to run a regression on the model, it reverted back to the prior separate labels in my logistic regression output.&amp;nbsp; Is there a command that would change the response labels permanently?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 22:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585963#M14422</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-03T22:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Combining SAS variable responses into one variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585968#M14424</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/169154"&gt;@jessho&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The if then statements did not work for me, but this proc format command initially did.&amp;nbsp; However, then when I went to run a regression on the model, it reverted back to the prior separate labels in my logistic regression output.&amp;nbsp; Is there a command that would change the response labels permanently?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to use the Format in the proc logistic.&lt;/P&gt;
&lt;P&gt;If you want to permanently assign the format you can do that manually (not recommended but you can) using the tableview or the SAS Exporere display columns. Or Proc Datasets (recommended for existing data sets). Or rerun a data step with the format assignment.&lt;/P&gt;
&lt;P&gt;Or just remember to use the format in the other procedures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm pretty leery about permanently assigning such formats as I might accidently forget that is a formatted value if I don't use the data set for awhile and wonder why it doesn't match the collection documents.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 22:24:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Combining-SAS-variable-responses-into-one-variable/m-p/585968#M14424</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-03T22:24:17Z</dc:date>
    </item>
  </channel>
</rss>

