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

n=7
x=c(9.8,10.2,10.4,9.8,10.0,10.2,9.6)
xbar=mean(x);xbar
s=sd(x);s
standard_error=s/sqrt(n)
standard_error
df=n-1;df
alpha=0.05
ttable=qt(1-alpha/2,df);ttable
confi_level=ttable*standard_error;confi_level
lower_limit=xbar-confi_level;lower_limit
upper_limit=xbar+confi_level;upper_limit


library("TeachingDemos")
x=c(9.8,10.2,10.4,9.8,10.0,10.2,9.6)
t.test(x,conf.level=0.95)
t.test(x,mu=10,conf.level=0.95)
t.test(x)
