Table of Contents

Tests of difference

Before going into this set of exercises, let's start by selecting the requested subsets of data. Here we can see different methods for doing this

> spearheads[ Loo ==1& Mat==1,]# it is a data frame, so we can treat it like a matrix (notice the final ‘, ’)> Socle[ Loo ==1& Mat==1,]# WRONG! DOESN'T WORK!> Socle[ Loo ==1& Mat==1]# good, because Socle is a vector

It's better to use intermediate objects to store data to be analysed. This way they can be easily reused later. Remember to choose object names that you can easily retrieve. It's better to be much more verbose than Fletcher and Lock are in their book. Extra characters are for free! .

A warning tells us there are several ties in each sample, which suggests strongly that these data
are from a discrete distribution (probably due to rounding).

Two sample t-test

Now we want to select another subset and run a two-sample t-test for a difference in lower socket length (Losoc) between those with pegs and those without for Bronze spearheads. Here is the subset selection: