Dear Faiz,

On Sat, Feb 13, 2010 at 11:42 PM, Faiz Rasool <fai...@gmail.com> wrote:

> The erorr I receive is "erorr in chisq.test(freq,p=prob)/6 probabilities
> must sum to 1"


This error message seems a little off.  It looks like the entire chi squared
test was divided by 6.  Notice that the /6 occurs *after* the closing
parenthesis for the test.

As others have noted, it is probably an input problem, but here is another
sample of code you could try.

## all of the data is entered directly into the function.  x is the data, p
are the probabilities.
## the biggest difference is rather than dividing by 6 to make the
probabilities sum to 1, the argument "rescale.p=T" will make sure that they
sum to 1

chisq.test(x=c(22,21,22,27,22,36), p=c(1,1,1,1,1,1), rescale.p=T)

        Chi-squared test for given probabilities
data:  c(22, 21, 22, 27, 22, 36)
X-squared = 6.72, df = 5, p-value = 0.2423



>
> I am very new to R, so any help would be appreciated.
> Faiz.
>
Best of luck to you!  I have found the list to be very helpful and
informative.

Joshua



-- 
Joshua Wiley
Senior in Psychology
University of California, Riverside
http://www.joshuawiley.com/

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to