inst/snippet/golfballs-pearson-sim.R

E <- rep(486/4,4)
rgolfballs <- rmultinom(n=10000,size=486,prob=rep(0.25,4))
chisqstat <- function(x) { sum((x-E)^2 / E) }
plot3 <- statTally(golfballs, rgolfballs, chisqstat, 
                   xlab=expression(X^2))

Try the fastR package in your browser

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

fastR documentation built on May 1, 2019, 11:18 p.m.