L5. Class work 1
L5. Class work 1
In City 2, a sample of 60 people in the same profession have mean income 7 lakh, stdev 1 lakh.
Does City 1 pay more on average? Confidence 95%. Assume population variances are equal.
If the last line assuming equal variance was not there, we would have to do F-test for Variance first
to see if Variances are equal or unequal. But now we can move directly to pooled-variance test.
Samples from two different populations, testing the mean, variances equal; we use the pooled-variance test.
df = n1 + n2 - 2 = 138
Right-tailed test, since tstat = 3.14 > |t(0.05,138)| = 1.656, reject H0.
So, City 1 does pay more than City 2 on average.
In City 1, a sample of 80 people in a profession have mean income 7.6 lakh, stdev 1.2 lakh.
In City 2, a sample of 60 people in the same profession have mean income 7 lakh, stdev 1 lakh.
Does City 1 pay more on average? Confidence 95%. Assume population variances are equal.
n1= 80 n2= 60
df1= 79 df2= 59
mean1= 7.6 mean2= 7
SD1= 1.2 SD2= 1
var1= 1.44 var2= 1
alpha= 0.05
F(stat)= 1.44
F(alpha,df1 1.506748
df1*var1 + df2*var2 /
df1+df2
Rejecting H0 since F(stat) > F(alpha,df1,df2)
H0: c1-c2<=0
H1: c1-c2>0
right tailed test
ar1 + df2*var2 /
A sample of 40 men have average height 171cm, stdev 16.2cm.
A sample of 50 women have average height 164cm, stdev 10.1cm.
Are men on average 10 cm taller than women? Alpha = 0.1. Assume unequal variances.
Samples from two populations, testing means, variances unequal; use separate-variance test.
Two-tailed test, since tstat = -1.023 is between +\- 1.67, we accept H0.
Thus, men are 10cm taller than women.
A sample of 40 men have average height 171cm, stdev 16.2cm.
A sample of 50 women have average height 164cm, stdev 10.1cm.
Are men on average 10 cm taller than women? Alpha = 0.1. Assume unequal variances.
n1= 40 n2= 50
df1= 39 df2= 49
mean1= 171 mean2= 164
SD1= 16.2 SD2= 10.1
var1= 262.44 var2= 102.01
T TEST
H0: mean1-mean2<=0
H1: mean1-mean2>0
T(stat)= -1.02292014517331
df= 62.2361066418964
T(alpha,df)= T.INV(alpha,df) -1.29535576176057
2.93278
73.98064
On Road 1, a sample of 213 cars travel at an average speed of 77.2 kmph, stdev 15.4.
On Road 2, a sample of 246 cars travel at an average speed of 74.4 kmph, stdev 10.8.
Is the variance of car speed the same on both roads? Alpha = 0.03.
Samples from two populations, testing the variance, we use the F-test for Variances. (L5 ppt slide 5)
alpha = 0.03
Since S1 > S2, Fstat = Larger variance / smaller variance = (S1^2)/(S2^2) = 2.033265
Since S1 > S2, df1 = n1 - 1 = 212 If S2 had been greater than S1, then
df2 = n2 - 1 = 245 Fstat = (S2^2)/(S1^2) and df1 = n2 - 1; df2 = n1 - 1.
Since Fstat = 2.03 > 1.28, reject H0. Thus, variances are not equal.
Is the average car speed of Road 1 higher than Road 2? Alpha = 0.03.
Sample from two populations, testing for mean, variances unequal (proven above), so we
use the separate-variance test.
Right-tailed test, since tstat = 2.22 > |t(0.03,df)| = 1.89, we reject H0. So, mean speed of Road 1 > Road 2.
On Road 1, a sample of 213 cars travel at an average speed of 77.2 kmph, stdev 15.4.
On Road 2, a sample of 246 cars travel at an average speed of 74.4 kmph, stdev 10.8.
Is the variance of car speed the same on both roads? Alpha = 0.03.
F(stat)= 2.033265
F(alpha,df1,df2)= 1.282639
a= 1.113427
rejecting H0, variances are unequal b= 0.474146
num= 2.52039
T test
den= 0.006765
H0= r1-r2=0
H1 r1-r2=!0
df= 372.544
T(stat)= 2.222241
T(alpha,df)= 1.886546
reject H0
not equal
7.2 kmph, stdev 15.4. On Road 1, a sample of 213 cars travel at an average speed of 77.2
4.4 kmph, stdev 10.8. On Road 2, a sample of 246 cars travel at an average speed of 74.4
Is the variance of car speed the same on both roads? Alpha = 0.03.
T TEST
H0:
H1:
T(stat)= ref
df= ref
T(alpha,df)= T.INV(alpha,df)
H0: 1-2=0
H1: 1-2!=0
right / left / two tailed test
SE= ref
T(stat)= 2.222241 2.8 1.25999
df= 372.544 2.52039 0.006765
T(alpha,df) 2.178448
NO SE REQUIRED
Variance test
< t(alpha,df)
In a sample of 243 people from City 1, 67 say they regularly drink cola.
In a sample of 306 people from City 2, 52 say they regularly drink cola.
Is the proportion of cola drinkers in City 1 more than 5% higher than that of City 2? Alpha = 0.01.
Samples from two populations, testing the proportion, Z-test for difference in proportion L5 slide 7
x1= 67 x2= 52
n1= 243 n2= 306
p1= 0.27572 p2= 0.169935
confidence level=
alpha= 0.01
H0: p1-p2<=0.05
H1: p1-p2>0.05
right tailed test