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

alpha=0.05
o=c(7,15,10,8)
e=c(10.13883546,10.71936969,10.33025370,8.81154111)
k=4
m=2
chisquare_compute=sum((o-e)^2/e);chisquare_compute
v=k-m-1;v
one_tailed_sig=1-pchisq(chisquare_compute,v);one_tailed_sig
chisq_critical=qchisq(1-alpha,v);chisq_critical


o=c(7,15,10,8)
e=c(10.13883546,10.71936969,10.33025370,8.81154111)
chisq.test(o,p=e,rescale.p=TRUE)

