Unformatted text preview: STAT 350 – Spring 2009 Lab #4 SOLUTION (corrected)
ttests All the following analyses should be conducted using SAS.
For all tests, use a significance level of 0.05.
Attach the SAS input (editor window content) as an appendix at the end of your assignment.
For this assignment, sample means, sample standard deviations, test statistics, and pvalues must
be taken from the SAS output and without any additional rounding.
1. The following in a contrived example to make sure you understand how to obtain the
appropriate pvalue from SAS. I have arbitrarily labeled the two groups “dogs” and “cats”.
Assume you wish to test the null hypothesis: µd  µc = 0, where µd denotes the true mean
[whatever] for dogs and µc denotes the true mean [whatever] for cats. The data from a
random sample of dogs and cats follow.
dogs: 47.0 28.2 37.2 47.7 52.4
61.0 62.8
39.1 62.0
43.1 67.3
33.1 cats: 65.7 88.1 79.3 73.2 43.6
76.9 74.6
56.4 51.2 51.2 a. Paste the SAS output from the ttest as your answer to part (a).
The TTEST Procedure
Statistics Variable species x
x
x c
d
Diff (12) N
10
12 Lower CL
Mean Mean Upper CL
Mean Lower CL
Std Dev Std Dev Upper CL
Std Dev Std Err 55.512
40.261
5.3802 66.02
48.408
17.612 76.528
56.556
29.843 10.104
9.0842
10.477 14.689
12.824
13.695 26.817
21.773
19.776 4.6452
3.7019
5.8637 TTests
Variable Method Variances x
x Pooled
Satterthwaite Equal
Unequal DF t Value Pr > t 20
18.1 3.00
2.97 0.0070
0.0083 Equality of Variances
Variable
x Lab #4  SOLUTION Method
Folded F Num DF
9 Den DF
11 F Value
1.31 Pr > F
0.6603 Page 1 of 1 b. Complete the table below by filling in the appropriate pvalue for each condition. Alternative Hypothesis
µd  µc ≠ 0
same as µc  µd ≠ 0
µd  µc < 0
same as µc  µd > 0
µd  µc > 0
same as µc  µd < 0 do not
assume equal variance
0.0083 assume equal variance
0.0070 0.00415 0.0035 0.99585 0.9965 Note: SAS made “cat” group #1 and “dog” group #2, because cat comes before dog
alphabetically. So the test statistics (t = 3.00 and t = 2.97) given were for the null
hypothesis: µc  µd = 0. The test statistics for the null hypothesis: µd  µc = 0 would have
been 3.00 and 2.97.
Also note that there is absolutely no evidence that µd  µc > 0 (µd > µc), because the
sample mean for dogs was actually LESS THAN the sample mean for cats. If you had a
small pvalue (0.0035 or 0.00415) for that alternative hypothesis, you would conclude
that µd  µc > 0 (µd > µc), which, logically, must be wrong! Do not disconnect your
calculations from logic and reason!
c. Is the assumption of equal variance appropriate? Give both the appropriate pvalue and
your conclusion. Use α = 0.05.
Yes, the assumption of equal variance is appropriate (pvalue = 0.6603)
2. The Survey of Study Habits and Attitudes (SSHA) is a psychological test that measures
students' study habits and attitude toward school. Scores range from 0 to 200. Higher scores
indicate better attitudes. An educational psychologist believes that older students have a
better attitude toward school than younger students. To test this theory, she gives the SSHA
test to a group of students with ages between 18 and 21 and to another group with ages
between 30 and 40. She brings the results of their tests (below) to you for help with the
analysis.
young: 115
119 124
124 90
86 118
79 116
161 157
108 127
108 80
130 old: 116 122 127 131 122 119 122 121 a. State the null and alternative hypotheses. Use µy to denote the true mean SSHA score for
the population of “young” students and use µo to denote the true mean SSHA score for
the population of “old” students.
H0: µo  µy = 0
Ha: µo  µy > 0
Ha: µy  µo < 0
Another acceptable set of hypotheses: H0: µy  µo = 0 Lab #4  SOLUTION Page 2 of 2 b. Conduct a ttest, and copy and paste the output of the analysis onto your assignment as
your answer to part (b).
The TTEST Procedure
Statistics Variable age N score
score
score old
young
Diff (12) 8
16
Lower CL
Mean Mean Upper CL
Mean Lower CL
Std Dev Std Dev Upper CL
Std Dev Std Err 118.63
102.42
10.45 122.5
115.13
7.375 126.37
127.83
25.204 3.0606
17.607
15.355 4.6291
23.835
19.854 9.4215
36.89
28.1 1.6366
5.9588
8.5969 TTests
Variable Method Variances score
score Pooled
Satterthwaite Equal
Unequal DF t Value Pr > t 22
17.1 0.86
1.19 0.4002
0.2489 Equality of Variances
Variable Method score Folded F Num DF Den DF F Value Pr > F 15 7 26.51 0.0002 c. Is the assumption of equal variances appropriate? Give both the appropriate pvalue and
your conclusion.
No, the assumption of equal variance is NOT appropriate (pvalue = 0.0002)
d. What was the standard deviation of SSHA scores for the "young" students? What was
the standard deviation of SSHA scores for the "old" students?
sy = 23.835
so = 4.6291
e. What was the mean SSHA score for the "young" students? What was the mean SSHA
score for the "old" students? μy = 115.13
μo = 122.5 Lab #4  SOLUTION Page 3 of 3 f. Give the value of the appropriate test statistic and the appropriate pvalue for the test of
your hypotheses in (a).
The value of the appropriate test statistic, t = 1.19
pvalue: 0.2489/2 = 0.12445
Note: to be technically correct,
if your hypotheses were: H0: µo  µy = 0 & Ha: µo  µy > 0,
then the test statistic is t = +1.19
if your hypotheses were: H0: µy  µo = 0 & Ha: µy  µo < 0,
then the test statistic is t = 1.19
either way, the pvalue would be 0.12455
g. What can the educational psychologist conclude based on this test? Be sure to be
technically correct!
Based on this test, there is no the mean SSHA scores for older students are not
statistically significantly higher than the mean SSHA scores for younger students.
3. Does a pretty nurse raise blood pressure? A cardiologist suspects that measurements of his
male patients' blood pressure have been artificially elevated since he hired a young, attractive
nurse. To test this theory, on a particular day, he randomly selects some male patients to
have their blood pressure taken by the new female nurse and the others to have their blood
pressure taken by a male nurse. The resulting systolic blood pressure values are given in the
table below.
female nurse
130
134
146
151
152
155
142
127
139
140
139 male nurse
134
133
145
145
130
137
123
131
138
134
136
135
145 a. State the null and alternative hypotheses. Use µf to denote the true mean blood pressure
when read by the female nurse and use µm to denote the true mean blood pressure when
read by the male nurse
H0: µf  µm = 0 Ha: µf  µm > 0 Another acceptable set of hypotheses: H0: µm  µf = 0
Lab #4  SOLUTION Ha: µm  µf < 0
Page 4 of 4 b. Conduct a ttest, and copy and paste the output of the analysis onto your assignment as
your answer to part (b).
The TTEST Procedure
Statistics Variable gender N BP
BP
BP f
m
Diff (12) 11
13 Lower CL
Mean Mean Upper CL
Mean Lower CL
Std Dev Std Dev Upper CL
Std Dev Std Err 135.29
131.96
1.044 141.36
135.85
5.5175 147.43
139.73
12.079 6.3138
4.6088
5.9731 9.0363
6.4271
7.7232 15.858
10.609
10.931 2.7245
1.7826
3.164 TTests
Variable Method Variances BP
BP Pooled
Satterthwaite Equal
Unequal DF t Value Pr > t 22
17.7 1.74
1.69 0.0951
0.1077 Equality of Variances
Variable Method BP Folded F Num DF Den DF F Value Pr > F 10 12 1.98 0.2629 c. Is the assumption of equal variances appropriate? Give both the appropriate pvalue and
your conclusion.
Yes, the assumption of equal variances is appropriate (pvalue = 0.2629)
d. What was the standard deviation of the systolic readings for the patients with the female
nurse? What was the standard deviation of the systolic readings for the patients with the
male nurse?
sf = 9.0363
sm = 6.4271
e. What was the mean systolic reading for the patients with the female nurse? What was
the mean systolic reading for the patients with the male nurse?
µf = 141.36
µm = 135.85 Lab #4  SOLUTION Page 5 of 5 f. Give the value of the appropriate test statistic and the appropriate pvalue for the test of
your hypothesis in (a).
Test statistic: t = 1.74
pvalue: 0.0951/2 = 0.04755
Note: to be technically correct,
if your hypotheses were: H0: µf  µm = 0 & Ha: µf  µm > 0
then the test statistic is t = +1.74
if your hypotheses were: H0: µm  µf = 0 & Ha: µm  µf < 0
then the test statistic is t = 1.74
g. What can the cardiologist conclude based on this test? Be sure to be technically correct!
Based on this test, the cardiologist can conclude that the blood pressure readings for his
patients are statistically significantly higher when taken by the female nurse compared to
when taken by the male nurse. Lab #4  SOLUTION Page 6 of 6 Appendix
Do not forget to include your SAS code (the contents of the Editor window) as an appendix at
the end of your assignment.
data prob1;
input species
cards;
d 47.0
d
d 28.2
d
c 65.7
c
c 88.1
c
; $ x @@;
37.2
47.7
79.3
73.2 d
d
c
c 52.4
61.0
43.6
76.9 d
d
c
c 62.8
39.1
74.6
56.4 d 62.0
d 43.1
c 51.2 d 67.3
d 33.1
c 51.2 proc ttest data=prob1;
class species;
var x;
run;
data ssha;
input age $ score
cards;
young 115
young 116
young 119
young 161
old
116
old
122 old 121
; @@;
young
young
young
young
122 124
157
124
108
old 127 young
young
young
young
old 90
127
86
108
131 f
f 146
127 f
f 151
f
152
139 f
140 m
m
m 145
131
145 m
m 145
138 old young
young
young
young
122 118
80
79
130
old
119 old proc ttest data=ssha;
class age;
var score;
run;
data nurse;
input gender $ BP @@;
cards;
f
130
f
134
f
155
f
142
f
139
m
134
m
133
m
137
m
123
m
136
m
135
;
run; m
m 130
134 proc ttest data=nurse;
class gender;
var BP;
run; Lab #4  SOLUTION Page 7 of 7 ...
View
Full
Document
This note was uploaded on 02/16/2010 for the course STAT 350 taught by Professor Staff during the Spring '08 term at Purdue.
 Spring '08
 Staff

Click to edit the document details