pivo=c(0.510, 0.462, 0.491, 0.466, 0.451, 0.503, 0.475, 0.487, 0.512, 0.505) # 1. -> sami (opakovani z minula) # 2. # test v N(mu,sigma^2), kde sigma zname -> testova statistika T=sqrt(n)*(mean(X)-mu_0)/sigma n=length(pivo) # testova statistika T=sqrt(n)*(mean(pivo)-0.5)/0.02 print(abs(T)) # kvantil N(0,1) na hladine 1-alpha/2: qnorm(1-0.05/2) # 3. -> sami (modifikace predchoziho) # 4. sigma nezname -> jednovyberovy t-test # testova statistika T=sqrt(n)*(mean(X)-mu_0)/S T=sqrt(n)*(mean(pivo)-0.5)/sd(pivo) print(abs(T)) # kvantil t_(n-1) na hladine 1-alpha/2: qt(1-0.05/2,df=n-1) # 5. -> sami (modifikace predchoziho) # 6. curve(dnorm(x),-3,3,lwd=2) curve(dt(x,df=2),-3,3,col="red",add=TRUE,lwd=2) curve(dt(x,df=5),-3,3,add=TRUE,col="blue",lwd=2) curve(dt(x,df=10),-3,3,add=TRUE,col="green",lwd=2) curve(dt(x,df=50),-3,3,add=TRUE,col="salmon",lwd=2) # kvantily: q=c(0.95,0.975,0.99) qt(q,df=2) qt(q,df=5) qt(q,df=10) qt(q,df=50) qnorm(q) #7. t.test(pivo,mu=0.5) t.test(pivo,mu=0.5,alternative="less") # 8. #a) hist(pivo) hist(pivo,prob=T) curve(dnorm(x,mean(pivo),sd(pivo)),add=TRUE) # b) qqnorm(pivo) qqline(pivo)