options(scipen=999)
options(digits=9)

s0_square=0.81
alpha=0.05
x=c(5.25,3.76,5.36,3.67,6.05,3.89,3.39,6.12,6.49,6.03)
n=length(x);n
s=sd(x);s
s^2
chisq_compute=(n-1)*s^2/s0_square;chisq_compute
v=n-1;v
if(s^2<s0_square) one_tailed_sig=pchisq(chisq_compute,v)
if(s^2>=s0_square) one_tailed_sig=1-pchisq(chisq_compute,v)
one_tailed_sig
two_tailed_sig=2*one_tailed_sig;two_tailed_sig



library(TeachingDemos)
x=c(5.25,3.76,5.36,3.67,6.05,3.89,3.39,6.12,6.49,6.03)
sigma.test(x,sigmasq=0.81)



library(TeachingDemos)
x=c(5.25,3.76,5.36,3.67,6.05,3.89,3.39,6.12,6.49,6.03)
sigma.test(x,sigmasq=1.69)
