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]
We will need two data sets for this activity, a set of sleep times for
this class (SleepData.csv) and a set of hypothesized sleep
times (HypoSleep.csv). Let's start with our class.
classdata = read.csv("/home/rebelsky/Stats115/Data/SleepData.csv")
So, what does that table look like again?
>head(classdata)HoursSlept1 5.502 10.003 5.754 7.505 11.006 7.00
Okay, just one column, named HoursSlept. How many values
are in that column?
>length(classtimes$HoursSlept)[1] 31
What about the hypothetical data?
hyposleep = read.csv("/home/rebelsky/Stats115/Data/HypoSleep.csv")
And what are those columns named?
>head(hyposleep)Sample1 Sample2 Sample3 Sample41 7.5 5.1 6.1 7.72 7.4 9.1 7.3 8.43 6.8 4.7 6.1 5.64 7.3 5.2 6.9 5.05 6.1 7.2 6.5 5.96 5.4 5.3 5.2 8.9
The authors clearly intend for you to do this test “manually”, first computing the mean and standard deviation, then computing the test statistic, and finally looking up the p-value in the table.
There are two kinds of technology appropriate for filling in the table. You can use the applet. I'll admit that I find that an attractive option, since it shows you the parts of the curve for that proportion.
However, you may find it easier, faster, and more accurate to use R. Minimally, you should know what commands are appropriate. In this case, our alternative is two-sided, so we use a slightly different command.
t.test(hyposleep$Sample1, mu=7, alternative="two.sided") t.test(hyposleep$Sample2, mu=7, alternative="two.sided") t.test(hyposleep$Sample3, mu=7, alternative="two.sided") t.test(hyposleep$Sample4, mu=7, alternative="two.sided")
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.