inst/snippet/golfballs-pearson.R

# manual calculation
O <- golfballs; O
E <- rep(486/4,4); E
X <- sum ( (O - E)^2 / E); X
1 - pchisq(X,df=3)

# repeated using built-in method
chisq.test(O)

Try the fastR package in your browser

Any scripts or data that you put into this service are public.

fastR documentation built on May 2, 2019, 5:53 p.m.