Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not: chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60),c(80,80,80, 80, 80, 80, 80, 80, 80, 80, 80, 80))) Pearson's Chi-squared test data: rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60), c(80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80)) X-squared = 17.6, df = 11, p-value = 0.09142 Is this correct? If I'm doing the same thing using Excel I obtained a different value of p.. (1.65778E-14) Thanks a lot, Bianca
Bianca Vieru- Dimulescu wrote:> Hello, > > I'm trying to calculate a chi-squared test to see if my data are > different from the theoretical distribution or not: > > chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, > 60),c(80,80,80, 80, 80, 80, 80, 80, 80, 80, 80, 80))) > > Pearson's Chi-squared test > > data: rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60), c(80, > 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80)) > X-squared = 17.6, df = 11, p-value = 0.09142 > > Is this correct? If I'm doing the same thing using Excel I obtained a > different value of p.. (1.65778E-14) > > Thanks a lot, > BiancaIt would be unusual to have 12 observed frequencies all equal to 80. So I'm guessing that you have a 12-category variable and want to test its fit to a discrete uniform distribution. I assume that your frequencies are x <- c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60) Then just use chisq.test(x) (see the help page). (If those 80's are expected cell frequencies, they should sum to sum(x) = 851.) I don't know what Excel does. Peter Peter Ehlers University of Calgary> > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Hi Bianca, you could see my contribute "Fitting distribution with R", pagg. 16-18: http://cran.r-project.org/doc/contrib/Ricci-distributions-en.pdf Hoping it could help you. Regards, Vito From: Bianca Vieru- Dimulescu <bianca.vieru <at> free.fr> Subject: [R] Chi-squared test Date: 2005-11-24 11:13:24 GMT (2 hours and 23 minutes ago) Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not: chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60),c(80,80,80, 80, 80, 80, 80, 80, 80, 80, 80, 80))) Pearson's Chi-squared test data: rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60), c(80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80)) X-squared = 17.6, df = 11, p-value = 0.09142 Is this correct? If I'm doing the same thing using Excel I obtained a different value of p.. (1.65778E-14) Thanks a lot, Bianca Diventare costruttori di soluzioni Became solutions' constructors "The business of the statistician is to catalyze the scientific learning process." George E. P. Box "Statistical thinking will one day be as necessary for efficient citizenship as the ability to read and write" H. G. Wells Top 10 reasons to become a Statistician 1. Deviation is considered normal 2. We feel complete and sufficient 3. We are 'mean' lovers 4. Statisticians do it discretely and continuously 5. We are right 95% of the time 6. We can legally comment on someone's posterior distribution 7. We may not be normal, but we are transformable 8. We never have to say we are certain 9. We are honestly significantly different 10. No one wants our jobs Visitate il portale http://www.modugno.it/ e in particolare la sezione su Palese http://www.modugno.it/archivio/palesesanto_spirito/