# Practicals 7 people<-read.csv2("01_data.csv", sep=";") people<-people[,1:3] summary(people) means<-aggregate(people$height, list(people$eye.color, people$sex), mean) library(sciplot) ses<-aggregate(people$height, list(people$eye.color, people$sex), se) dfs<-aggregate(people$height, list(people$eye.color, people$sex), length) dfs<-dfs$x-1 sds<-aggregate(people$height, list(people$eye.color, people$sex), sd) ns<-aggregate(people$height, list(people$eye.color, people$sex), length) ses<-sds$x/sqrt(ns$x) CI.low<-means$x+ses$x*qt(0.025, dfs) CI.high<-means$x+ses$x*qt(0.025, dfs, lower.tail=F) x.coord<-barplot(means$x, ylim=c(150, 200)) arrows(x0=x.coord, y0=CI.low, y1=CI.high, code=3, angle=90, length=0.03) qt(0.025, 1000) ### task 2 ran<-read.delim2("clipboard") summary(ran) t.test(AL~sp, data=ran) t.test(AL~sp, data=ran, var.equal=T) boxplot(AL~sp, data=ran) ### Task 3 fert<-read.delim2("clipboard") summary(fert) t.test(fert$F, fert$NF, paired=T) t.test(fert$F, fert$NF, paired=F) boxplot(fert$F-fert$NF)