mean(people$height) var(people$height) sd(people$height) tapply(people$height, list(people$eye.color, people$sex), mean) cat.means<-aggregate(people$height, list(people$eye.color, people$sex), mean) names(cat.means)<-names(people) names(cat.means)[3]<-"mean.height" cat.means cat.vars<-aggregate(people$height, list(people$eye.color, people$sex), var) cat.vars cat.sd<-aggregate(people$height, list(people$eye.color, people$sex), sd) cat.sd library(sciplot) se cat.se<-aggregate(people$height, list(people$eye.color, people$sex), se) cat.se std.err <- function(x) sd(x)/sqrt(length(x)) cat.se2<-aggregate(people$height, list(people$eye.color, people$sex), std.err) cat.se2 #task 2 ?rnorm plants<-rnorm(10, 25.5, 2.4) plants<-rnorm(n=100, mean=25.5, sd=2.4) mean(plants) se(plants) var(plants) 2.4^2 plants.2<-plants plants.2[2]<-plants[2]*10 mean(plants) mean(plants.2) hist(plants.2) median(plants) median(plants.2) ###Task 3 pnorm(2.5, 2.1, sqrt(0.9), lower.tail=F)