<?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: Chi Sqare test using calculated means in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777396#M38092</link>
    <description>If you're looking to compare the distribution of the scores between the groups then you'd run a proc freq and chi square test to see if the distribution was different. For survey data this is typical but requires count data not means. &lt;BR /&gt;You can test if the means are different across a set of scores by groups to see if they differ..but it's a different test with a different hypothesis. &lt;BR /&gt;ANOVA or T-Test requires means. &lt;BR /&gt;Pick one and go with it, but right now it seems like you're mixing them. &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 29 Oct 2021 19:39:08 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-10-29T19:39:08Z</dc:date>
    <item>
      <title>Chi Sqare test using calculated means</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777389#M38089</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to assess the relationship between calculated mean scores of grouped survey questions (continuous variable) and various categorical demographic variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I performed a chi square test between the mean of grouped survey questions and a categorical age variable. Is it correct to include the frequency of each observation in the table while calculating the chi square, even though I am weighting by means?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc summary data=formatting mean std n noprint;
class agec;
var mean_func ;
var mean_sc ;
var mean_acc ;
var mean_qa ;
var mean_out ;
var mean_part ;
var mean_sat ;
var mean_qol;

output out=b1_stats;
output out=mean1 mean=;
run;



data b1_stats2;
format _STAT_ $30.;
set b1_stats;
run;

proc sort data=b1_stats2
out=b1_stats;
by agec _TYPE_ _stat_;
run;

proc transpose data=b1_stats out=b1_han;
by agec _TYPE_;
id _stat_;
run;


data b1_table /*(keep= _TYPE_ _STAT_ Adult_Survey_Results Responses)*/;
format Adult_Survey_Results $40.;

set b1_han;
if _NAME_ = 'mean_acc' then Adult_Survey_Results= 1 ;
else if _NAME_= 'mean_qa' then Adult_Survey_Results= 2;
else if _NAME_= 'mean_func' then Adult_Survey_Results=7;
else if _NAME_= 'mean_sat' then Adult_Survey_Results=5 ;
else if _NAME_= 'mean_out' then Adult_Survey_Results= 3;
else if _NAME_= 'mean_sc' then Adult_Survey_Results= 6 ;
else if _NAME_= 'mean_part' then Adult_Survey_Results= 4;
else if _NAME_= 'mean_qol' then Adult_Survey_Results= 8 ;

Responses=N;
STD1=STD;
run;



proc freq data=b1_table;
tables agec*Adult_Survey_Results / list chisq;
where agec not in (99);
weight mean;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frequency report without frequency:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bazingarollcall_0-1635532666794.png" style="width: 621px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65243i59474E9DF4B8AC03/image-dimensions/621x471?v=v2" width="621" height="471" role="button" title="bazingarollcall_0-1635532666794.png" alt="bazingarollcall_0-1635532666794.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Frequency report with frequency:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bazingarollcall_1-1635532759301.png" style="width: 616px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65244iE24C57BE61E4C43D/image-dimensions/616x433?v=v2" width="616" height="433" role="button" title="bazingarollcall_1-1635532759301.png" alt="bazingarollcall_1-1635532759301.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is the p value 1 when the frequency is not included?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 18:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777389#M38089</guid>
      <dc:creator>bazingarollcall</dc:creator>
      <dc:date>2021-10-29T18:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Chi Sqare test using calculated means</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777393#M38090</link>
      <description>Out of curiousity, why did you come back to Chi Square? From what I recall from your last posts, wasn't T-test going to be more appropriate here? From your descriptions of the data, ANOVA seems the correct approach.</description>
      <pubDate>Fri, 29 Oct 2021 19:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777393#M38090</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-29T19:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Chi Sqare test using calculated means</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777394#M38091</link>
      <description>&lt;P&gt;The directions I was given say to "Run the appropriate statistics either chisq or mean scores with significance test", so I tried not to overthink it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your input about ANOVA, I've been switching back and forth on what to use.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 19:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777394#M38091</guid>
      <dc:creator>bazingarollcall</dc:creator>
      <dc:date>2021-10-29T19:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Chi Sqare test using calculated means</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777396#M38092</link>
      <description>If you're looking to compare the distribution of the scores between the groups then you'd run a proc freq and chi square test to see if the distribution was different. For survey data this is typical but requires count data not means. &lt;BR /&gt;You can test if the means are different across a set of scores by groups to see if they differ..but it's a different test with a different hypothesis. &lt;BR /&gt;ANOVA or T-Test requires means. &lt;BR /&gt;Pick one and go with it, but right now it seems like you're mixing them. &lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Oct 2021 19:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-Sqare-test-using-calculated-means/m-p/777396#M38092</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-29T19:39:08Z</dc:date>
    </item>
  </channel>
</rss>

