0% found this document useful (0 votes)
8 views

L5. Class work 1

The document presents statistical analyses comparing incomes in two cities, heights of men and women, and car speeds on two roads, using various hypothesis tests including t-tests and F-tests. It concludes that City 1 pays more than City 2 on average, men are not significantly taller than women by 10 cm, and the average speed of cars on Road 1 is higher than on Road 2. Additionally, it examines the proportion of cola drinkers in two cities, questioning if City 1's proportion is more than 5% higher than City 2's.

Uploaded by

srishparnami16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

L5. Class work 1

The document presents statistical analyses comparing incomes in two cities, heights of men and women, and car speeds on two roads, using various hypothesis tests including t-tests and F-tests. It concludes that City 1 pays more than City 2 on average, men are not significantly taller than women by 10 cm, and the average speed of cars on Road 1 is higher than on Road 2. Additionally, it examines the proportion of cola drinkers in two cities, questioning if City 1's proportion is more than 5% higher than City 2's.

Uploaded by

srishparnami16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 14

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.

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.

City 1: mean = xbar1 = 7.6 std dev = S1 = 1.2 size = n1= 80


City 2: mean = xbar2 = 7 std dev = S2 = 1 size = n2= 60

H0: City 1 <= City2 ----> City 1 - City 2 <= 0


H1: City 1 > City 2 ----> City 1 - City 2 > 0

Right tailed test, alpha = 1 - confidence = 0.05


Hypothesized difference = u1 - u2 = 0

df = n1 + n2 - 2 = 138

Sp^2 = ((n1 - 1)*(S1^2) + (n2 - 1)*(S2^2))/(n1-1+n2-1) = 1.251884

S.E. = ((Sp^2)*((1/n1)+(1/n2)))^0.5 = 0.191084

tstat = ((x1bar - x2bar) - (u1 - u2))/S.E. = 3.139972

|t(0.05,df)| = abs(t.inv(0.05,138)) = 1.65597

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 TEST two tailed test


H0= variances are equal
H1= variances are unequal

F(stat)= 1.44
F(alpha,df1 1.506748

df1*var1 + df2*var2 /
df1+df2
Rejecting H0 since F(stat) > F(alpha,df1,df2)

Using Separate Variance Test / Pooled Variance test

H0: c1-c2<=0
H1: c1-c2>0
right tailed test

SE= 1.251884 172.76 138


T(stat)= 3.139972 0.6 0.191084
df= 138
T(alpha,df) 1.65597
, stdev 1.2 lakh.
7 lakh, stdev 1 lakh.
iances are equal.

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.

Men mean = xbar1 = 171 std dev = S1 = 16.2 size = n1= 40


Women mean = xbar2 = 164 std dev = S2 = 10.1 size = n2= 50

H0: men - women = 10


H1: men - women != 10

Two-tailed test, alpha = 0.1


Hypothesized difference = u1 - u2 = 10

Let a = (S1^2)/n1 = 6.561 Let b = (S2^2)/n2 = 2.0402


Defining 'a' and 'b' is not necessary, we are just using it as a way to make the calculations simpler
df = ((a+b)^2) / ((a^2)/(n1-1) + (b^2)/(n2-1)) =

S.E. = (a+b)^0.5 = 2.93278

tstat = ((x1bar - x2bar) - (u1 - u2))/S.E. = -1.02292

+\- t(alpha/2,df) = +\- t.inv(0.05,df) = -1.669804 to 1.6698

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

F TEST two tailed test -3


H0= variances are equal 8.6012
H1= variances are unequal

F(stat)= higher variance / lower variance 2.57268895206352


F(alpha,df1,df2)= F.INV.RT(alpha,df1,df2) 1.47107451146256

Rejecting H0 since F(stat) > F(alpha,df1,df2)

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

Rejecting H0 since t(stat) >=< t(alpha,df)


ual variances.

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)

Road 1: mean = xbar1 = 77.2 stdev = S1 = 15.4 size= n1 = 213


Road 2: mean = xbar2 = 74.4 stdev = S2 = 10.8 size= n2 = 246

H0: Population variances are equal


H1: Population variances are not equal

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.

F(0.03,df1,df2) = f.inv.rt(0.03,212,245) = 1.282639

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.

H0: Road 1 - Road 2 <= 0


H1: Road 1 - Road 2 > 0

Right-tailed test, alpha = 0.03


Hypothesized difference = u1 - u2 = 0

Let a = (S1^2)/n1 = 1.113427


Let b = (S2^2)/n2 = 0.474146

df = ((a+b)^2) / ((a^2)/(n1-1) + (b^2)/(n2-1)) = 372.544

S.E. = (a+b)^0.5 = 1.25999

tstat = ((x1bar - x2bar) - (u1 - u2))/S.E. = 2.222241

|t(0.03,df)| = abs(t.inv(0.03,df)) = 1.886546

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.

n1= 213 n2= 246


mean1= 77.2 mean2= 74.4
SD1= 15.4 SD2= 10.8
var1= 237.16 var2= 116.64

F test two tailed test


H0= variances are equal
H1= variances are unequal

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.

n1= 213 n2=


df1= 212 df2=
mean1= 77.2 mean2=
SD1= 15.4 SD2=
var1= 237.16 var2=

F TEST two tailed test


H0= variances are equal
H1= variances are unequal

F(stat)= higher variance / lower variance


F(alpha,df1,df2)= F.INV.RT(alpha,df1,df2)

Rejecting H0 since F(stat) > F(alpha,df1,df2)

T TEST
H0:
H1:

T(stat)= ref
df= ref
T(alpha,df)= T.INV(alpha,df)

Rejecting H0 since t(stat) >=< t(alpha,df)


an average speed of 77.2 kmph, stdev 15.4. On Road 1, a sample of 213 cars travel at an average speed of 77.2
an average speed of 74.4 kmph, stdev 10.8. On Road 2, a sample of 246 cars travel at an average speed of 74.4
oth roads? Alpha = 0.03. Is the variance of car speed the same on both roads? Alpha = 0.03.

246 n1= 213 n2= 246


245 df1= 212 df2= 245
74.4 mean1= 77.2 mean2= 74.4
10.8 SD1= 15.4 SD2= 10.8
116.64 var1= 237.16 var2= 116.64
alpha= 0.03

F TEST two tailed test


H0= variances are equal
H1= variances are unequal
er variance
F(stat)= 2.033265
F(alpha,df1 1.282639

Rejecting H0 since F(stat) > F(alpha,df1,df2)

Using Separate Variance Test / Pooled Variance test

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

rejecting / accepting H0 since t(stat) >=< t(alpha,df)


an average speed of 77.2 kmph, stdev 15.4.
an average speed of 74.4 kmph, stdev 10.8.
oth roads? Alpha = 0.03.

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

City 1: Size= n1 = 243 Cola drinkers = x1 = 67 p1 = x1/n1 = 0.27572


City 2: Size= n2 = 306 Cola drinkers = x2 = 52 p2 = x2/n2 = 0.169935

H0: p(City 1) - p(City 2) <= 0.05


H1: p(City 1) - p(City 2) > 0.05

Right-tailed test of proportion, alpha = 0.01


Hypothesized difference = (pi1 - pi2) = 0.05

pbar = (x1 + x2)/(n1 + n2) = 0.216758

SEp = (pbar*(1-pbar)*((1/n1)+(1/n2)))^0.5 = 0.035404 (denominator of Zstat)

Zstat = ((p1 - p2) - (pi1 - pi2))/SEp = 1.575665

|Z(0.01)| = abs(norm.s.inv(0.01)) = 2.326348

Right-tailed test, Zstat = 1.576 < |Z(0.01)| = 2.326, so we accept H0.


Thus, Cola drinker proportion of City 1 - City 2 <= 5%.
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 =

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

p(bar)= 0.216758 denominator


Z(stat) 1.575665 0.055786 0.035404
Z(alpha)= 2.326348
than that of City 2? Alpha = 0.01.

You might also like