Next open a graphics window by typing motif()
or x11()
on a UNIX machine or win.start()
on a Windows machine.
A good place to start might be with summary statistics for helium footballs and regular footballs.
> summary(Helium)It looks like the helium footballs go a little further on average. Next we could look at box plots:
Min. 1st Qu. Median Mean 3rd Qu. Max.
11 24.5 28 26.38 30 39
> summary(Air)
Min. 1st Qu. Median Mean 3rd Qu. Max.
15 23.5 26 25.92 28.5 35
> boxplot(Helium, Air)Note that when you do this, S-PLUS does not label anything. We can add some titles:
> title(ylab="Distance Traveled")
> title(xlab="Helium (left) vs. Air (right)")
> title("Boxplots by Football Type")
> plot(Helium)This plot shows that there were a couple of relatively short kicks at the beginning, and then three shorts ones later which look to be outliers.
S-PLUS has a function which allows you to select points on a graph by
using the mouse. Once you have plotted a graph, you can run identify
on that graph. This allows you to identify the index of a point by clicking
with the left mouse button and to stop identifying by clicking with the
center mouse button (this is with a three-button mouse; if you have fewer
buttons, play around and figure out how to use identify
using
your mouse). I typed identify(Helium)
and clicked on each
of the three points to get their index number.
> summary(Helium[-c(11,25,30)])The median was unaffected by removing those three observations, but the mean increased slightly. It looks like helium-filled footballs travel about 1.6 yards further than regular footballs. The way to test whether this is significant is with a paired t-test (that is, the first air-kick compared to the first helium-kick, the second air-kick compared to the second helium-kick, etc. ). We must exclude the 11th, 25th and 30th distances travelled by air-filled footballs in order to have matched pairs for all footballs.
Min. 1st Qu. Median Mean 3rd Qu. Max.
14 25 28 27.56 30 39
> t.test(Helium[-c(11,25,30)],Air[-c(11,25,30)], paired=T)The
Paired t-Test
data: Helium[ - c(11, 25, 30)] and Air[ - c(11, 25, 30)]
t = 1.4923, df = 35, p-value = 0.1446
alternative hypothesis: true mean of differences is not equal to 0
95 percent confidence interval:
-0.5405538 3.5405538
sample estimates:
mean of x - y
1.5
p
-value is .14, so it appears that there is no significant
difference in the distance travelled by helium-filled and air-filled footballs.
Now that this analysis is complete, detach the football data frame from your search path.