<?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 PROC FREQ changing SCORES in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-changing-SCORES/m-p/857202#M338697</link>
    <description>&lt;P&gt;Hello I am running a Gamma Test but I want to see the effects over the value when the score values are changed.&lt;/P&gt;
&lt;P&gt;My understanding is that the default scores makes the ordinal variables as they appear with 1/2/3.... f I want something different what should be my option?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data status;
input socioecon $ mentalhealth $ count;
datalines;
low well 10
low mild 35
low moderate 26
med well 25
med mild 50
med moderate 32
high well 30
high mild 46
high moderate 26
;
run;
proc freq order=data;
weight count;
tables socioecon*mentalhealth/ scores= measures chisq relrisk riskdiff expected;
exact or;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 04 Feb 2023 20:45:43 GMT</pubDate>
    <dc:creator>Mruizv</dc:creator>
    <dc:date>2023-02-04T20:45:43Z</dc:date>
    <item>
      <title>PROC FREQ changing SCORES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-changing-SCORES/m-p/857202#M338697</link>
      <description>&lt;P&gt;Hello I am running a Gamma Test but I want to see the effects over the value when the score values are changed.&lt;/P&gt;
&lt;P&gt;My understanding is that the default scores makes the ordinal variables as they appear with 1/2/3.... f I want something different what should be my option?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data status;
input socioecon $ mentalhealth $ count;
datalines;
low well 10
low mild 35
low moderate 26
med well 25
med mild 50
med moderate 32
high well 30
high mild 46
high moderate 26
;
run;
proc freq order=data;
weight count;
tables socioecon*mentalhealth/ scores= measures chisq relrisk riskdiff expected;
exact or;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Feb 2023 20:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-changing-SCORES/m-p/857202#M338697</guid>
      <dc:creator>Mruizv</dc:creator>
      <dc:date>2023-02-04T20:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ changing SCORES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-changing-SCORES/m-p/857207#M338701</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/402297"&gt;@Mruizv&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you want to assign individual scores to the ordinal values of&amp;nbsp;&lt;FONT face="courier new,courier"&gt;socioecon&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;mentalhealth&lt;/FONT&gt;, e.g., low=1, med=3, high=7 and well=4, mild=11, moderate=38? Then you need to create numeric variables containing these numbers, say&amp;nbsp;&lt;FONT face="courier new,courier"&gt;socioecon_&lt;EM&gt;num&lt;/EM&gt;&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;mentalhealth_&lt;EM&gt;num&lt;/EM&gt;&lt;/FONT&gt;, from the existing character variables. You can use a user-defined format so that the values are still displayed as "low", "med", etc. Note, however, that the gamma statistic (unlike the Mantel-Haenszel chi-square and the Pearson correlation) will not be affected by this change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set status;
socioecon_num=choosen(whichc(socioecon, 'low','med','high'),1,3,7);
mentalhealth_num=choosen(whichc(mentalhealth, 'well','mild','moderate'),4,11,38);
run;

proc format;
value socifmt
1='low'
3='med'
7='high'
;
value mentfmt
4='well'
11='mild'
38='moderate'
;
run;

proc freq data=want order=data;
weight count;
format socioecon_num socifmt. mentalhealth_num mentfmt.;
tables socioecon_num*mentalhealth_num / scorout measures chisq expected;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have added the &lt;A href="https://documentation.sas.com/doc/en/statug/15.2/statug_freq_syntax08.htm#statug.freq.freqscorout" target="_blank" rel="noopener"&gt;SCOROUT option&lt;/A&gt; to the TABLES statement to include tables with the row and column scores in the output (and removed redundant and inapplicable options).&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 23:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-changing-SCORES/m-p/857207#M338701</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-02-04T23:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ changing SCORES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-changing-SCORES/m-p/857282#M338751</link>
      <description>&lt;P&gt;Thank you so much, the exercise indeed is to prove that gamma doesn't change. I had done it by hand but wanted to learn how to program it.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 21:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-FREQ-changing-SCORES/m-p/857282#M338751</guid>
      <dc:creator>Mruizv</dc:creator>
      <dc:date>2023-02-05T21:31:01Z</dc:date>
    </item>
  </channel>
</rss>

