#####example8
xA=c(10.08, 10.11, 10.09, 10.10, 10.12)
mean(xA)
var(xA)
sd(xA)
sd(xA)/mean(xA)
#####example9
pnorm((10.12-10.15)/0.02)
pnorm((10.2-10.15)/0.02)
#####example10
x=c(0.51,0.51,0.51,0.50,0.51,0.49,0.52,0.53,0.50,0.47,0.51,0.52,0.53,0.48,0.49,0.50,0.52,0.49,0.49,0.50,0.49,0.48,0.46,0.49,0.49,0.48,0.49,0.49,0.51,0.47,0.51,0.51,0.51,0.48,0.50,0.47,0.50,0.51,0.49,0.48,0.51,0.50,0.50,0.53,0.52,0.52,0.50,0.50,0.51,0.51)
hist(x)
hist(x,prob=TRUE)
curve(dnorm(x, mean=mean(x), sd=sd(x)), add=TRUE)
table(x)
mean(x)
sd(x)
n=length(x)
#####example11
CIU=mean(x)+qnorm(0.975)*sd(x)/sqrt(n)
CIU
CIL=mean(x)-qnorm(0.975)*sd(x)/sqrt(n)
CIL
CIU=mean(x)+qnorm(0.995)*sd(x)/sqrt(n)
CIU
CIL=mean(x)-qnorm(0.995)*sd(x)/sqrt(n)
CIL
#####example12
meanx=0.461
sdx=0.003
n=10
CIU=meanx+qt(0.975,9)*sdx/sqrt(n)
CIU
CIL=meanx-qt(0.975,9)*sdx/sqrt(n)
CIL
#####example13
x=c(2.15,1.13,2.04,1.45,1.35,1.09,0.99,2.07)
y=log10(x)
n=length(x)
logCIU=mean(y)+qt(0.975,7)*sd(y)/sqrt(n)
logCIU
logCIL=mean(y)-qt(0.975,7)*sd(y)/sqrt(n)
logCIL
CIU=10^(logCIU)
CIU
CIL=10^(logCIL)
CIL