# potrebne knihovny library (agricolae) library (BSDA) library (car) library (PMCMR) # Znamenkovy test tabulka <- read.csv2 (file = "../data/minuta.csv", header=FALSE) summary (tabulka) str (tabulka) X <- tabulka$V1 mean (X) median (X) qqnorm (X) qqline (X) boxplot (X, ylab="odhad minuty v sekundach") SIGN.test (X, md=60) # Wilcoxonuv signed-rank test wilcox.test (X, mu=60) # Dvouvyberovy Wilcoxonuv (rank-sum) test tabulka <- read.csv2 (file = "../data/pole.csv") summary (tabulka) str (tabulka) boxplot (vynos ~ hnojeni, data=tabulka, xlab="hnojeni", ylab="vynos") X <- subset (tabulka, hnojeni=="A")$vynos Y <- subset (tabulka, hnojeni=="B")$vynos wilcox.test (X, Y) # Kruskaluv-Wallisuv test v jednoduchem trideni tabulka <- read.csv2 (file = "../data/brambory.csv") summary (tabulka) str (tabulka) tabulka$odruda <- factor (tabulka$odruda) levels (tabulka$odruda) <- c ("A", "B", "C", "D") mean (tabulka$hmotnost) tapply (tabulka$hmotnost, tabulka$odruda, mean) median (tabulka$hmotnost) tapply (tabulka$hmotnost, tabulka$odruda, median) boxplot (hmotnost ~ odruda, data=tabulka, xlab="odruda", ylab="hmotnost") KWtest <- with (tabulka, kruskal (hmotnost, odruda)) KWtest # Medianovy test v jednoduchem trideni Mtest <- with (tabulka, Median.test (hmotnost, odruda)) Mtest