<?xml version="1.0" encoding="UTF-8"?>
<Worksheet><Version major="6" minor="0"/><View-Properties><Zoom percentage="100"/></View-Properties><Styles><Layout alignment="left" bullet="none" firstindent="0.0" leftmargin="0.0" linebreak="space" name="Normal" rightmargin="0.0" spaceabove="0.0" spacebelow="0.0"/><Layout alignment="left" bullet="none" linebreak="any" name="Line Printed Output"/><Font background="[0,0,0]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" name="Maple Input" opaque="false" size="12"/><Font background="[0,0,0]" family="Monospaced" foreground="[0,0,255]" name="Line Printed Output" opaque="false" readonly="true" size="12"/></Styles><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">"Here is a program that will help you to do a chi-squared test":


ChiTest:=proc(E,F)
local r,s,i;
r:=0;
for i from 1 to nops(E)
do
r:=r+((E[i]-F[i])^2)/E[i];
od;
s:=evalf(100*(1-stats[statevalf,cdf,chisquare[nops(E)-1]](r)));
lprint("The chi-squred value is",evalf(r),"where there are", 
nops(E),"classes, and a probabilty of about ",
s,"percent that the null hypothesis is true and we see such a distribution."); 
if 
s &gt; 5
then 
lprint("In particular this test is not significant and we should not reject the null hypothesis based on it");
fi;

if 
1&lt;s and s&lt;= 5
then 
lprint("In particular this test is significant and we may reject the null hypothesis based on it");
fi;
if 
s&lt;=1 then 
lprint("In particular this test is highly significant and we may reject the null hypothesis based on it");
fi;
end:</Text-field></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input">ChiTest([58*.125,58*.125,58*.375,58*.375],[4,4,17,33]);</Text-field></Input><Output><Text-field layout="Line Printed Output" style="Line Printed Output">"The chi-squred value is", 9.770114943, "where there are", 4, "classes, \
and a probabilty of about ", 2.06248005, "percent that the null hypothes\
is is true and we see such a distribution."
"In particular this test is significant and we may reject the null hypot\
hesis based on it"
</Text-field></Output></Group><Group><Input><Text-field layout="Normal" prompt="&gt; " style="Maple Input"/></Input></Group><Text-field/></Worksheet>