options(scipen=999)
options(digits=9)
cat("\014") # clear screen
rm(list=ls(all=TRUE))

alpha=0.05
o=c(24,98,95,23)
e=c(30,90,90,30)
chisquare_compute=sum((o-e)^2/e);chisquare_compute
v=3
one_tailed_sig=1-pchisq(chisquare_compute,3);one_tailed_sig
chisq_critical=qchisq(1-alpha,v);chisq_critical

o=c(24,98,95,23)
e=c(1/8,3/8,3/8,1/8)
chisq.test(o, p=e, rescale.p = TRUE)


o=c(24,98,95,23)
e=c(1/8,3/8,3/8,1/8)
chisq.test(o, p=e)
