Skip to content

chisq.,test`

3 messages · Stephen Choularton, Gavin Simpson, (Ted Harding)

#
On Fri, 2005-08-26 at 18:15 +1000, Stephen Choularton wrote:
I get no syntax error on R 2.1.1-patched. I do get an error though:

Error in chisq.test(c(11, 13, 12, 18, 21, 43, 15, 12, 9, 10, 5, 28,
22,  :
        probabilities must sum to 1.

Which leads us to question the values you provided as argument p (which
I assigned to a vector P first)

sum(P)
[1] 0.999783

So you need to make sure your probabilities add sum to one.

HTH

Ps. It would have been helpful if you'd posted the syntax error you
received and your version of R - type version at the R prompt.

Gav

<snip>
#
On 26-Aug-05 Stephen Choularton wrote:
Having cut&pasted your data as published in your email into R-1.8.0
on Red Hat Linux 9, I encountered no "syntax error" and got the
result:

  data:  c(11, 13, 12, 18, 21, 43, 15, 12, 9, 10, 5, 28, 22, 11, 15,
  [...]

  X-squared = 1094.448, df = 414, p-value = < 2.2e-16

Fee: For each P-value of the form "x.ye-N", N beers.

Hoping this helps ... though your "syntax error" remains mysterious.

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 26-Aug-05                                       Time: 09:53:38
------------------------------ XFMail ------------------------------