0% found this document useful (0 votes)
46 views31 pages

Hypothesis Testing 2: Testing Percentages and Differences of Means

The document discusses hypothesis testing for population proportions and differences in means. It explains how to test whether a sample proportion accurately represents the true population proportion using a z-test. It also explains how to test whether two sample means or proportions are significantly different using a z-test or t-test, calculating the standard error and test statistic to compare to critical values. Examples are provided to demonstrate conducting these tests to determine if null hypotheses can be rejected or not.

Uploaded by

Nawshin Dastagir
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views31 pages

Hypothesis Testing 2: Testing Percentages and Differences of Means

The document discusses hypothesis testing for population proportions and differences in means. It explains how to test whether a sample proportion accurately represents the true population proportion using a z-test. It also explains how to test whether two sample means or proportions are significantly different using a z-test or t-test, calculating the standard error and test statistic to compare to critical values. Examples are provided to demonstrate conducting these tests to determine if null hypotheses can be rejected or not.

Uploaded by

Nawshin Dastagir
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 31

Hypothesis Testing 2

Testing Percentages and differences of means

Test of Population Proportion


You will often have sample survey data that shows that a percentage of people said yes to a question A test of a population proportion will allow you to test whether your sample evidence is likely to represent the true population percentage who would say yes to the question

Test of Population Proportion


Testing a population proportion (), using a sample proportion (P) Only difference is the standard error of proportions SE(p) measured using: SE(p) = ({(1- )}/n) z calculation using: z = (P - )/SE(p)

Example
Career unit claims 50% of population of graduates have a job by June. Sample n=30 gives p = 33% Test the hypothesis that careers unit claims are correct. Ho: 0.5 Ha: < 0.5 Significance level = 0.05

Critical value z = -1.65 SE(p) = [(0.5)(0.5)/30] = 0.09 as p = 0.33, converts to z score z = (0.33-0.5)/0.09 = -1.88 z = -1.88 < -1.65 so is in the rejection region Reject Ho. Accept Ha: less than 50% of graduates have a job by June

Sampling Dist Proportions SEp

p=0.33

= 0.5

ps

5% of lowest ps in rejection region

-1.88 -1.65

=0 Standard Normal

Zs

Tests of differences of means


Suppose have sample wage data on two different companies and the two sample mean wages are different A test of difference of means lets you test whether the observed difference between sample means indicates the samples were drawn from the same population or different populations with different means

Tests of significant difference


Test for differences between two sample means Requires SE(differences of means) If both samples are drawn from the same population, a large difference between sample parameters is unlikely

Sampling Dist Diff of means

SE (x1 -x2)

(x1 -x2)s

Standard Normal 1

2.5% of highest (x1 -x2)s in the rejection region

Zs
-1.96

=0

1.96

A test of differences of means


Sample data on daily wages from 2 firms (1 and 2) shows: n1 = 30, x1 = 180, s1 = 14 n2 = 40, x2 = 170, s2 = 10 Does the evidence show firm 1 pays a higher mean daily wage This difference could be due to chance rather than a distribution difference

Doing the test


Set up the hypotheses as a 2 tailed test The population means for each sample are either the same (both sample means come from the same population) or they are not the same and hence come from different populations with different population means so
Ho: 1 = 2 H1: 1 2

The critical value for the test


Choose a significance level If the level is 5%, = 0.05 For a 2 tailed test, the probability in each tail 0.025 As both samples, n > 30, we can use a Z score for the test Critical value of Z = 1.96 from the tables

The test statistic


We want to test whether the difference between the means is significantly different from zero The test statistic is therefore Z = (x1 -x2) (1 - 2) / SE(x1 -x2) Z = (x1 -x2) / SE(x1 -x2) SE(x1 -x2) is the SE of the difference of means

To calculate SE(x1 -x2)


SE(x1 -x2) = (21 + 22) n1 n2 If n1 and n2 > 30 use sample standard deviation values if 21 22 are unknown SE = [(14)2/30 + (102)/40] SE = 3.01

Calculating the test statistic


Z = (x1 -x2) / SE(x1 -x2) Z = (180 170)/3.01 = 10/3.01 = +3.32 Compare Z score to the critical value = +1.96 +3.32 > + 1.96 Z score is in the top rejection region of the distribution Ho is rejected

Sampling Dist Diff of means

SE (x1 -x2)

(x1 -x2)s

Standard Normal 1

2.5% of highest (x1 -x2)s in the rejection region

Zs
-1.96

=0

1.96

3.32

Interpretation
Rejecting Ho: 1 = 2 The observed difference of sample mean wages is not due to chance We reject the idea that our two samples of daily wages were drawn from the same population of wages with only 1 population mean wage

Interpretation
Accepting H1: 1 2 means that the samples were drawn from 2 different populations of data The observed difference of sample means is significant and reflects a difference in the population means from which they were drawn It is likely that firm 1 pays more than firm 2 on average

USING EXCEL
Use Data Analysis add-in under tools Choose z test: two sample for means or if either sample is smaller than 30 choose t test: two sample assuming equal variances Highlight variable range for first sample Highlight variable range for second sample Choose sig level.

Difference of proportions
A similar test can be done when you have data on 2 samples which give 2 sample proportions or percentages You can test whether the observed difference in proportions is due to chance or due to differences in the populations from which the samples were drawn, the only difference is the standard error of the difference of proportions

Sampling Dist Diff of proportions

SE(p1-p2)

0 2.5% of lowest (p1 - p2)s in the rejection region 1

(p1 -p2)s

Zs =0 Standard Normal

The standard error of difference of proportions


Standard error of diff proportions= SE (p1-p2) p1 = sample 1 proportion p2 = sample 2 proportion = estimated population proportion SE (p1-p2) = [ (1- ) + (1- ) ] n1 n2 = (n1p1 + n2p2)/ (n1 + n2)

An example
Data is available from 2 surveys of the % of households with smokers n1 = 50 n2 = 50 and p1 = 20% p2 = 30% Survey 2 shows a higher % of smokers but is this difference due to chance or due to a difference in the populations from which the 2 surveys were drawn?

The hypotheses and critical value


The null hypothesis, as before, is that there is no difference between the population proportions from which the 2 samples were drawn (they are drawn from the same population Ho: 1 = 2 H1: 1 2 For significance level = 0.01 (2 tailed) Z critical value = + or 2.58

Calculating the SE (p1-p2)


= (n1p1 + n2p2)/ (n1 + n2) = (50(0.20) + 50(0.30)/ (50 + 50) = 0.25 SE (p1-p2) = [ (1- ) + (1- ) ] n1 n2 SE (p1-p2) = [ 0.25(0.75) + 0.25(0.75) ] 50 50 SE (p1-p2) = [ 0.00375 + 0.00375 ] = 0.087

Calculating test statistic


The test statistic Z = (p1 p2)/ SE (p1-p2) Z = (0.20 0.30)/0.087 = -0.10 / 0.087 = -1.15 Compare Z score to the critical Z value -1.15 > -2.58, so Z test score is not in the rejection region We cannot reject Ho

Sampling Dist Diff of proportions

SE(p1-p2)

0 0.5% of lowest (p1 - p2)s in the rejection region 1

(p1 -p2)s

Zs
-2.58 -1.15

=0 Standard Normal

Interpretation
We accept the null Ho: 1 = 2 There is no difference between the population proportions from which the samples were drawn The apparent difference of proportions is due to chance Both samples are drawn from a population of people with an estimated population of 25% smokers

Final Points
You now know that observed sample data values do not necessarily mean that the population also has this value You also know that observed differences between 2 sample values does not necessarily mean that the difference is significant Be careful, observed patterns from sample data may be due to chance. Test them.

Final Points
You now know that observed sample data values do not necessarily mean that the population also has this value You also know that observed differences between 2 sample values does not necessarily mean that the difference is significant Be careful, observed patterns from sample data may be due to chance. Test them.

Final Points
You now know that observed sample data values do not necessarily mean that the population also has this value You also know that observed differences between 2 sample values does not necessarily mean that the difference is significant Be careful, observed patterns from sample data may be due to chance. Test them.

You might also like