Skip to content

exact goodness-of-fit test

2 messages · Christine A., Spencer Graves

2 days later
#
I don't know of an existing R function to do this.  However, it 
should not be too hard, especially if I had only one with the numbers 
you gave.  I'd compute the observed chi-square, then construct a series 
of 4 nested "for" loops to generate all 5969040 = 22!/(15! 0! 3! 4!) 
possible outcomes that sum to 22, compute the chi-square for each, and 
count how many have a chi-square at least as extreme as what you 
observed.  If I wanted a general algorithm, that would take more work.

	  If you'd like more help than this, PLEASE do read the posting guide! 
"http://www.R-project.org/posting-guide.html", show us your code and 
where you got stuck.

	  spencer graves
Christine Adrion wrote: