Introduction to Statistics (MAT/SST 115.03 2008S)
Primary: [Front Door] [Syllabus] [Current Outline] [R] - [Academic Honesty] [Instructions]
Groupings: [Applets] [Assignments] [Data] [Examples] [Handouts] [Labs] [Outlines] [Projects] [Readings] [Solutions]
External Links: [R Front Door] [SamR's Front Door]
You can load the sample NBA points data with
nba = read.csv("/home/rebelsky/Stats115/Data/NBAPoints.csv")
You will note that there are two columns in the data frame: One for the date in which the game was played and one for the total score that night.
>
head(nba)
Date Points
1 12/10/1999 196
2 12/10/1999 198
3 12/10/1999 205
4 12/10/1999 163
5 12/10/1999 184
6 12/10/1999 224
It's been awhile, so you may not remember the techniques we use for visual displays of quantitative data. Let's review. You can try
library(BHH2, lib="/home/rebelsky/Stats115/Packages") dotPlot(nba$Points)
hist(nba$Points)
qqnorm(nba$Points, datax=T) qqline(nba$Points, datax=T)
A quick reminder ...
mean(nba$Points) sd(nba$Points)
You should compute the t-test statistic using the formula on p. 395. Note that you'll need to parenthesize the denominator.
(x_bar - mu_0)/(s/sqrt(n))
After using the applet, you might also just want to have R compute the test statistic and p-value directly from the original data.
t.test(nba$Points, mu=183.2, alternative="greater")
Sometimes you just have the test statistic, and not the original data
(or just the mean and standard deviation, and not the original data,
in which case you can compute the test statistic). In that case,
you can still have R compute the p-value using
the pt
function. You need to supply the test
statistic and the degrees of freedom. As is the case for the
standard normal probability table, this gives the area to the
left, so you will need to subtract it from 1.
pt(3.13, df=24)
Primary: [Front Door] [Syllabus] [Current Outline] [R] - [Academic Honesty] [Instructions]
Groupings: [Applets] [Assignments] [Data] [Examples] [Handouts] [Labs] [Outlines] [Projects] [Readings] [Solutions]
External Links: [R Front Door] [SamR's Front Door]
Copyright (c) 2007-8 Samuel A. Rebelsky.
This work is licensed under a Creative Commons
Attribution-NonCommercial 2.5 License. To view a copy of this
license, visit http://creativecommons.org/licenses/by-nc/2.5/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.