Você está na página 1de 8

STAT3010: Lecture 3

REVIEW OF HPYOTHESIS TESTS-CONTD


Two Independent Populations (not equal variances)
Example: An experiment was conducted involving the comparison of the
mean heart rates following 30 minutes of aerobic exercise in females
aged 20 to 24 as compared to females aged 25-30. For this experiment,
10-second heart rates are recorded on each participant following 30
minutes of intense aerobic exercise and converted to beats per minute.
The sample data are
Statistic
Sample size
Mean heart rate
Variance in heart rates

Age: 20-24
15
146.22
40.0

Age: 25-30
10
141.10
10.0

Use the data to test if there is a significant difference in the mean heart
rates following 30 minutes of aerobic exercise between the two groups.

to

x1 x 2 ( 1 2 )
s12 s 22

n1 n2

[( se1 ) 2 ( se2 ) 2 ]2
df
( se1 ) 4 ( se2 ) 4

n1 1 n2 1

STAT3010: Lecture 3
Example: An educator believes that new reading activities in the
classroom will help elementary school pupils improve some aspects of
their reading ability. She arranges for a third-grade class of 21 students to
take part in these activities for an eight week period. A control classroom
of 23 third-graders follows the same curriculum without the activities. At
the end of the eight weeks, all students are given a Degree of Reading
Power (DRP) test, which measures the aspects of reading ability that the
treatment is designed to improve. The data appear in the following table.
DRP scores for third-graders
Treatment Group
24 61 59 46 43 44 52
43 58 67 62 57 71 49
54 43 53 57 49 56 33

42
42
60
85

SAS CODE:
options LS=80 PS=60
nodate;
data DRP;
input Group $ x;
cards;
T 24
T 61
T 59
.
.
.
C 42
C 33
C 46
.
.
.
;
Proc ttest;
class group;
var x;
run;
2

Control Group
33 46 37 43 41 10
55 19 17 55 26 54
28 62 20 53 48 37
42

STAT3010: Lecture 3

SAS OUTPUT:

Variable
x
x
x

The TTEST Procedure


Statistics

Group
C
T
Diff (1-2)

Lower CL
Mean
34.106
46.466
-18.82

N
23
21

Mean
41.522
51.476
-9.954

Upper CL
Mean
48.937
56.487
-1.091

Lower CL
Std Dev
13.263
8.4213
11.998

Std Dev
17.149
11.007
14.551

Statistics

Variable
x
x
x

Upper CL
Std Dev
24.271
15.895
18.495

Group
C
T
Diff (1-2)

Std Err
3.5758
2.402
4.3919

Minimum
10
24

Maximum
85
71

T-Tests
Variable
x
x

Method
Pooled
Satterthwaite

Variances
Equal
Unequal

DF
42
37.9

t Value
-2.27
-2.31

Pr > |t|
0.0286
0.0264

Two Dependent Populations (paired data)


relevant formulas:
n

i 1

sd

i 1

2
i

di

i 1

n
n 1

d d
sd
n

with

df = n-1

STAT3010: Lecture 3

Example: A nutrition expert is examining a weight-loss program


to evaluate its effectiveness. Ten subjects are randomly
selected for the investigation. The subjects initial weights are
recorded, they follow the program for 6 weeks, and they are
weighed again. The data are as follows:
Subject
1
2
3
4
5
6
7
8
9
10

Initial Weight
180
142
126
138
175
205
116
142
157
136

Final Weight
165
138
128
136
170
197
115
128
144
130

Do the data suggest that the weight-loss program worked?

STAT3010: Lecture 3

SAS CODE:
options LS=80 PS=60
nodate;
data paired;
input preweight postweight;
d=preweight-postweight;
lines;
180
165
142
138
126
128
138
136
175
170
205
197
116
115
142
128
157
144
136
130
;
proc means mean
std t prt;
title 'Paired t-test';
proc print;
run;

SAS OUTPUT:

Paired t-test
The MEANS Procedure

Variable
Mean
Std Dev
t Value
Pr > |t|

preweight
151.7000000
27.4268725
17.49
<.0001
postweight
145.1000000
24.8616170
18.46
<.0001
d
6.6000000
5.8156876
3.59
0.0059

Paired t-test
Obs
1
2
3
4
5
6
7
8
9
10

preweight
180
142
126
138
175
205
116
142
157
136

postweight
165
138
128
136
170
197
115
128
144
130

d
15
4
-2
2
5
8
1
14
13
6

STAT3010: Lecture 3

Categorical Data - Chi-Square Tests


relevant formulas:
n

2
0 =

(Oij Eij ) 2
Eij

i 1 j 1

Eij

( ri )(c j )
n

df = (r-1)(c-1)

NOTE: The Chi Square distribution is a right skewed distribution and has a
single parameter called its degrees of freedom. Table B.5 is used for a
critical region.
Example: The following data were collected in a multisite observational
study of medical effectiveness in Type II diabetes. Three sites were
involved: a health maintenance organization (HMO), a university teaching
hospital (UTH), and an independent practice association (IPA). Type II
diabetic patients were enrolled in the study from each site and monitored
over a 3-year observation period. The data shown display the treatment
regimens of patients measured at baseline by site.
Treatment Regimen
Diet & Exercise
Oral Hypoglycemics
294
827
132
288
189
516
615
1631

Site
HMO:
UTH:
IPA:
Total:

Insulin
579
352
404
1335

Total
1700
772
1109
3581

We wish to use the data to test the hypothesis that the two variables (site
and treatment regimen) are independent (i.e., no difference in treatment
regimens across sites). The hypotheses are written as follows:

Eij

( ri )(c j )
n

STAT3010: Lecture 3
n

02 =

i 1 j 1

(Oij Eij ) 2
Eij

SAS CODE:
options LS=80 PS=60
nodate;
data independent;
input site $ trt $ count;
cards;
hmo
hmo
hmo
uth
uth
uth
ipa
ipa
ipa

diet
oral
insulin
diet
oral
insulin
diet
oral
insulin

294
827
579
132
288
352
189
516
404

;
run;
proc freq;
tables site*trt/expected cellchi2 chisq;
weight count;
title 'Chi-Square Test for Independence';
proc print;
run;

STAT3010: Lecture 3

SAS OUTPUT:

Chi-Square Test for Independence


The FREQ Procedure
Table of site by trt
site
trt
Frequency

Expected

Cell Chi-Square
Percent

Row Pct

Col Pct
diet
insulin oral
Total

hmo

294
579
827
1700
291.96 633.76 774.28
0.0143 4.7318 3.5895

8.21 16.17 23.09 47.47


17.29 34.06 48.65
47.80 43.37 50.71

ipa

189
404
516
1109
190.46 413.44 505.1
0.0112 0.2154 0.235

5.28 11.28 14.41 30.97


17.04 36.43 46.53
30.73 30.26 31.64

uth

132
352
288
772
132.58 287.8 351.61
0.0026 14.32 11.509

3.69
9.83
8.04 21.56
17.10 45.60 37.31
21.46 26.37 17.66

Total
615
1335
1631
3581
17.17
37.28
45.55
100.00
Statistics for Table of site by trt
Statistic
DF
Value
Prob

Chi-Square
4
34.6291
<.0001
Likelihood Ratio Chi-Square
4
34.4975
<.0001
Mantel-Haenszel Chi-Square
1
10.5953
0.0011
Phi Coefficient
0.0983
Contingency Coefficient
0.0979
Cramer's V
0.0695
Sample Size = 3581
Chi-Square Test for Independence
Obs
1
2
3
4
5
6
7
8
9

site

trt

count

hmo
hmo
hmo
uth
uth
uth
ipa
ipa
ipa

diet
oral
insulin
diet
oral
insulin
diet
oral
insulin

294
827
579
132
288
352
189
516
404

Você também pode gostar