qnorm(0.5) qnorm(0.25) qnorm(0.75) qnorm(0.25, 3, sqrt(5)) qchisq(0.025, 25) qt(0.99, 30) qt(0.05, 14) qf(0.975, 5,20) qf(0.05, 2,10) #delka bantuske tvare setwd("~/") x <- c(67, 67, 63, 68, 70, 70, 75, 74, 80, 77, 77, 67, 64) x <- sort(x) n <- length(x) m <- mean(x) s2 <- var(x) s <- sd(x) Tab <- data.frame(m=m, s2=s2, s=s, row.names='akcie') round(Tab, digits=2) # P(X>=70) pst <- sum(x>=70)/length(x) pst2 <- 1-sum(x<70)/length(x) round(pst,4) round(pst2,4) # zavislost delky a sirky lebky data <- read.delim('16-anova-head.txt', sep='\t') muzi <- data[data$sex=='m',] head.w <- muzi$head.W bizyg.w <- muzi$bizyg.W cov(head.w, bizyg.w) # 31.83 cor(head.w, bizyg.w) # 0.6785 plot(head.w, bizyg.w) data <- read.delim('16-anova-head.txt', sep='\t') muzi <- data[data$sex=='m',] head.w <- muzi$head.W bizyg.w <- muzi$bizyg.W bigo.w <- muzi$bigo.W m <- mean(bigo.w) s <- sd(bigo.w) alpha <- 0.05 n <- length(bigo.w) dh <- m-s/sqrt(m)*qt(1-alpha/2, n-1) hh <- m-s/sqrt(m)*qt(alpha/2, n-1) round(dh, 4) round(hh, 4) dh <- m-s/sqrt(n)*qt(1-alpha, n-1) dh hh <- m-s/sqrt(n)*qt(alpha, n-1) hh