(X2 =sum((of-ef)^2/ef)) # observed value of X2
(df =k-1-2) # degrees of freedom
1-pchisq(X2,df) # p-value
Gives something like this:
Except where otherwise specified, all text and images on this page are copyright InfluentialPoints, all rights reserved. Images not copyright InfluentialPoints credit their source on web-pages attached via hypertext links from those images.