Chi-square Goodness of Fit Test
Not quite. There is a chisq.test() in the ctest library, but that does Pearson chi-square tests of contingency tables. Looking at chisq.gof, it seems to (1) cut the data into bins (you can use hist() to do this); (2) calculate the expected numbers in each bin using the differences of the CDF (pnorm, pexp, etc.); (3) calculate sum((exp-obs)^2/exp); (4) find the tail probability of the chi-square distribution (pchisq). So the answer is no, but putting the pieces that you need together shouldn't be too hard if you have a basic knowledge of R. If you're really stuck, ask again. Ben
On Fri, 3 Nov 2000, Matthias Fischer wrote:
Dear R-users, is there a function for the Chi-square Goodness of Fit Test in R (compare function chisq.gof in S/S-PLUS). Thanks for help. Matthias Seitzinger -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
318 Carr Hall bolker at zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker Box 118525 (ph) 352-392-5697 Gainesville, FL 32611-8525 (fax) 352-392-3704 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._