egypt=read.csv("S:/Courses/stat-renaes/Stat404/Egypt skulls.csv",header=T) head(egypt) attach(egypt) # boxplot boxplot(breadth~era) # histograms by era # you will need to install a package called lattice install.packages("lattice") library(lattice) histogram(~breadth|era, type='count', main="Egyptian Skull Breadths \n BCE200 and BCE4000") # Now for some basic summary statistics. There is a package that can give you all of the # needed statistics (mean, median, standard deviation, variance, sample size, etc.) # when you have a grouping variable (the era). If you just had different quantitative variables with # no grouping variable, then you'd use a different one called stat.desc in the pastecs package install.packages("psych") library(psych) describeBy(breadth,era) # You will need the tilde (~) here to denote the grouping variable since there are not two # separate quantitative variables (if you did have two separate variables, # then you would just separate them by a comma) # variance test first var.test(breadth~era) # now t-test t.test(breadth~era,var.equal=T) # can do one tail if needed: t.test(breadth~era,var.equal=T,alternative="greater") detach(egypt)