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

Hypothesis Testing

The document provides an overview of hypothesis testing, including types of data, hypothesis tests for qualitative data, and the importance of hypotheses in guiding studies. It discusses the normal distribution, confidence intervals, and various statistical tests such as the Z-test and T-test, along with examples and calculations. Additionally, it covers concepts of Type I and Type II errors, significance levels, and the application of these tests in real-world scenarios.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Hypothesis Testing

The document provides an overview of hypothesis testing, including types of data, hypothesis tests for qualitative data, and the importance of hypotheses in guiding studies. It discusses the normal distribution, confidence intervals, and various statistical tests such as the Z-test and T-test, along with examples and calculations. Additionally, it covers concepts of Type I and Type II errors, significance levels, and the application of these tests in real-world scenarios.
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 71

Hypothesis Testing

Presented by:
ANGANA SAHU
VINEET KOTHARI
SUMITI SIDANA
ANIL GOENKA
Data Types

Data
Data

Quantitative
Quantitative Qualitative
Qualitative

Discrete
Discrete Continuous
Continuous
Hypothesis Tests
Qualitative Data
Qualitative
Qualitative
Data
Data

22 or
or more
more
11 prop.
prop. prop.
prop.
Proportion
Proportion Independence
Independence

22 prop.
prop.

ZZ Test
Test ZZ Test
Test 22 Test
Test 22 Test
Test
Why Hypotheses?
 Guides the direction of the study
 Identifies facts that are relevant

 A good hypothesis should fulfill two

conditions:
• Must be adequate for its purpose
• Must be testable
The Normal Distribution
Many continuous variables follow a normal distribution, and it plays a
special role in the statistical tests we are interested in;

•The x-axis represents the values of a particular


variable
•The y-axis represents the proportion of
68% of dist.
members of the population that have each value
1 s.d. 1 s.d. of the variable
•The area under the curve represents probability
x of an individual having a value in that range
X

Mean and standard deviation tell you the basic features of a distribution
mean = average value of all members of the group
standard deviation = a measure of how much the values of individual
members vary in relation to the mean
• The normal distribution is symmetrical about the mean
Normal Distribution and Confidence
Intervals
Any normal X 
distribution can be Z
transformed to a 
standard distribution
(mean 0, s.d. = 1)
using a simple
transform

/2 = 0.025 /2 = 0.025


1- = 0.95

-1.96 1.96
0.025 = p-value: probability of a measurement value not belonging to this distribution
Multi-Sample: Setting Up the
Hypothesis
H0: 1  2 H0: 1 - 2  0
OR Right
H1: 1 > 2 H1: 1 - 2 > 0 Tail

H0: 1 OR H0: 1 - 2  Left


H1: 
 21
< 2 H1: 1 - 2 < 0 Tail

H0: 1 = 2 H0: 1 -2 = 0


OR Two
H1: 1  2 H1: 1 - 2  0 Tail
The Z-test
• The z-test is based upon the standard normal
distribution.
X 
Z

n
• It uses the standard normal distribution in the
same way. In this case we are making
statements about the sample mean, instead of
the actual data values.
The Z-test – (cont.)

• Note that the Z-test is based upon


two parts.
• The standard normal transformation

Xi  
Zi 

• The standard deviation of the
sampling distribution.
The Z-test – an example

• Suppose that you took a sample of 25 people


in Mumbai and found that their personal
income is Rs. 24,379
• And you have information that the national
average for personal income per capita is
Rs.31,632 in 2003. S.D.= Rs.15000
• Is Mumbai’s personal income significantly
different from the National Average?
What to conclude?
• Should you conclude that Mumbai’s
personal income is lower than the
national average?
• Is it significantly lower?
• Could it simply be a randomly “bad”
sample”?
• Assume that it is not a poor sampling
technique
• How do you decide?
Example (cont.)
 We will hypothesize that Mumbai’s
income is lower than the national
average.
• H0: MUMInc = INDInc (Null Hypothesis)
• HA: MUMInc < INDInc (Alternate
Hypothesis)

 Since we know the national average


(Rs.31,632) and standard deviation
(Rs.15000), we can use the z-test to
make decide if Mumbai is indeed
significantly lower than the nation
Example (cont.)
Using the z-test, we get
The Critical Values of Z to
memorize
 Two tailed hypothesis
• Reject the null (H0) if z  1.96, or z
 -1.96
 One tailed hypothesis
• If HA is Xbar > , then reject H0 if z 
1.645
• If HA is Xbar < , then reject H0 if z 
-1.645
Application:
 Allows us to use sample data to test a

claim about a population, such as


testing whether a population mean
equals sample mean.
Example 1 :Company has to supply memory
chips with 4000 rating points. If its quality std exceeds
this then it will increase the cost of production
otherwise will cancel the order.
Company has taken a sample of 100 units

Identified that a S.D of 200 rating points exist.


As per test the mean quality std was 3980


Test hypothesis that there’s


no difference in mean quality
std of the sample at 5% LOS
Example:
μ0 = 4000 rating points, σ=200points,n=100,x =3980points

H0: μ=4000a
Ha: μ=4000, S.E= σ/n½=200/100½=20 rating points.

Z= X- μ0 =3980-4000 =-1
S.E 20

Population
Obtained
mean=-1

-1

Ho
Sample=100
Basic idea:

Sampling Distribution

It is unlikely that ... Therefore, we


we would get a reject the null
sample mean of hypothesis that  =
this value ... 50.

... if in fact this were


the population mean.

20  = 50 Sample Mean
Determining the error involved

The Null hypothesis


If false
If true

Rejects Does not Rejects


Does not reject
reject

Correct
Correct Type1 Type2 error
Decision
Decision error
Alpha:α Beta :β
Alpha (α)
 Note that alpha (α) is:
• The probability of rejecting the null
hypothesis when the null is in fact true.
• It is this the probability of making a
Type I error
• By convention, we usually set α=.05

(1 time out of 20 by chance alone)


• A good working rule is to always use
α=.05 until you know when not to….
Beta ()
 Beta () is:
• The probability of failing to reject the
null hypothesis when the alternate is in
fact true.
• It is thus the probability of making a
Type II error.
• We can never really know , because we
never know the “true” situation.
• α and  are inversely related.
How p (type I) error be reduced ?

How p (type I) error be reduced ?


Type1 error when multiple comparisons are done

Divide α by no. of tests, for new α

So if Alpha is originally set at 0.05, and five tests are being


done, the new Alpha is 0.05/5 = 0.01. So a P value from any
of the five comparisons must be less than or equal to 0.01 to
be considered statistically significant.
The T test
 When we do not have the population
standard deviation, we must employ a
different statistical test

 Think of it this way:


• The sample standard deviation is biased a little
low, but we know that as the sample size gets
larger, it becomes closer to the true value.
• As a result, we need a sampling distribution that
makes small sample estimates conservative, but
gets closer to the normal distribution as the
sample size gets larger, and the sample standard
deviation more closely resembles the population
standard deviation.
The T-test (cont.)
 The t-test is a very similar formula.

 Note the two differences


• using s instead of 
• The resultant is a value that has a t-
distribution instead of a standard normal
one.
The T distribution
 The t distribution is a statistical
distribution that varies according to
the number of degrees of freedom
(Sample size – 1)
 As df gets larger, the t approximates
the normal distribution.
 For practical purposes, the t-
distribution with samples greater
than 30 can be viewed as a normal
distribution.
Two Sample test
Comparison of two population means

Two sample

Independent Dependent

One tail / Two tail One tail / Two tail


Z-test / t-test Z-test / t-test
Two – tailed Z – test
Independent data

 To determine whether the hourly wages of


semi skilled workers are same in two cities.

City Mean hourly Standard Size of


H  :  1  2 earnings from deviation
sample (Rs) of
sample

sample
Ha :  1  2 A 8.95 0.4 200

 0.05 B 9.10 0.6 175


CALCULATION

σ1^ =s1= 0.4 σ1^ =s1= 0.6


σ(x1-x2)^ = (σ12^/n1 + σ22^/n2)½ = 0.053

Z = (x1 – x2) – (μ1 – μ2)Ho = -2.83


σ(x1-x2)^
One tailed - t – test
Independent Data

Program Mean No. of SD of


Sampled sensitivit manager sensitivity
y s after program
observed
 Two major New 92% 12 15%
differences Old 84% 15 19%
 Standard error of the
difference between the
two sample means.
 Degrees of freedom
H  :  1  2
 Example
 Whether the sensitivity Ha :  1   2
achieved by the new
program is significantly  0.05
higher than the older one.
CALCULATION

Here we assume for a moment that σ12^ = σ22^ = pooled


estimate of σ2

Sp2 = (n1- 1)s12 + (n2-1)s22 σ(x1-x2)^ = Sp(1/n1 +1/n2)½

n1 + n 2 - 2
= 301.160 = 6.721

t = (x1 – x2) – (μ1 – μ2)Ho = 1.19


σ(x1-x2)^
Tmes = 1.708
Conclusion: Null hypothesis is accepted.
Dependent sample
 Allows to control for extraneous factors.
 Both the samples to be of same size.
 Example:
 A health spa has advertised a weight-reducing program.
 Claims that the participant loses more than 17 pounds.
 Selects randomly records of 10 participants and records
weight before and after the program.

Before 189 202 220 207 194 177 193 202 208 233

After 170 179 203 192 172 161 174 187 186 204

H  : l 17
Answer
Ha : l  17
 0.05
Finding the mean weight loss and S.D

Before After Loss (d) Loss square(d2)


189 170 19 361
202 179 23 529
220 203 17 289
207 192 15 225
194 172 22 484
177 161 16 256
193 174 19 361
202 187 15 225
208 186 22 484
233 204 29 841
∑d=197 ∑d2= 4055
d = 197/10=19.7
Calculations contd.

S = (∑d2-n(d)2)½ = 4.40 S.E = s/n½ = 1.39


(n-1)
tcal = x – μHo = (19.7-17)/1.39 = 1.94
S.E
tmes = 1.833
Single Sample T-test
 t-test: Used to compare the mean of a sample to a known
number (often 0).
 Assumptions: Subjects are randomly drawn from a population
and the distribution of the mean being tested is normal.
 Test: The hypotheses for a single sample t-test are:
• Ho: u = u0
• Ha: u < > u0

(where u0 denotes the


hypothesized value to which
you are comparing a
population mean)

 p-value: probability of error in rejecting the hypothesis of no


difference between the two groups.
Independent Group t-test
 Independent Group t-test: Used to compare the means of two
independent groups.

 Assumptions: Subjects are randomly assigned to one of two


groups. The distribution of the means being compared are normal
with equal variances.
 Example: Test scores between a group of patients who have been given a
certain medicine and the other, in which patients have received a
placebo
Test: The hypotheses for the comparison of two independent groups
are:
• Ho: u1 = u2 (means of the two groups are equal)
• Ha: u1 <> u2 (means of the two group are not equal)

 A low p-value for this test (less than 0.05 for example) means
that there is evidence to reject the null hypothesis in favour of
the alternative hypothesis.
Dependent T-test
 Dependent t-test:
• Most commonly used to evaluate the difference in
means between two groups.
• Used to compare means on the same or related subject
over time or in differing circumstances.
• Compares the differences in mean and variance
between two data sets

 Assumptions: The observed data are from the same


subject or from a matched subject and are drawn
from a population with a normal distribution.
 Can work with very small values.
Dependent T-test
 Characteristics: Subjects are often tested in a
before-after situation (across time, with some
intervention occurring such as a diet), or subjects
are paired such as with twins, or with subject as
alike as possible.

 Test: The paired t-test is actually a test that the


differences between the two observations is 0.
So, if D represents the difference between
observations, the hypotheses are:
• Ho: D = 0 (the difference between the two
observations is 0)
• Ha: D= 0 (the difference is not 0)
Calculating T-test (T statistic)
 First calculate t statistic value and then calculate p value

 For the paired student’s t-test, t is calculated using the


following formula:
mean ( d )
t Where d is calculated by d i  xi  yi
 (d )
n
And n is the number of pairs being tested.

 For an unpaired (independent group) student’s t-test, the


following formula is used:

mean ( x )  mean ( y )
t
 2 ( x)  2
 ( y)
n( x )
Where σ (x) is the standard deviation of nx( yand
) n (x) is the number of
elements in x.
Two-sample T-test
 Frequently we need to compare the
means of two different samples.
 Is one group higher/lower than some
other group?
 e.g. is the Income of blacks
significantly lower than whites?
 The two-sample t difference of means
test is the typical way to address this
question.
Examples
 Is the income of blacks lower
than whites?
 Are teachers salaries in IBS and

IIM are alike?


 Is there any difference between

the students of IBS and the


students of IIM?
The Difference of means Test
 Frequently we wish to ask questions
that compare two groups.
• Is the mean of A larger (smaller) than B?
• Are As different (or treated differently)
than Bs?
• Are A and B from the same population?
 To answer these common types of
questions we use the standard two-
sample t-test
The Difference of means Test
 The standard two-sample t-test is:

X1  X 2
t
2 2
s s

1 2
n1 n2
The standard two sample T-test
 In order to conduct the two sample t-
test, we only need the two samples
 Population data is not required.
 We are not asking whether the two
samples are from some large
population.
 We are asking whether they are from
the same population, whatever it may
be.
Normal Distribution vs T-distribution
 t-test is based on t distribution (z-test was based
on normal distribution)
 Difference between normal distribution and
t-distribution

Normal t-distribution
distribution
Hypothesis Testing: Two Sample
Tests
TEST FOR EQUAL MEANS TEST FOR EQUAL VARIANCES

Ho Ho
Population 1
Population 1

Population 2
Population 2

Ha Ha Population 1

Population 1 Population 2 Population 2

If standard deviation known use z Use t test, 2 or more sample-> f-


test, else use t-test test
The Equal Variance test
 If the variances from the two
samples are the same we may
use a more powerful variation
X1  X 2
t
2 1 1
s   
t
 n1 n2 
 Where
Which test to Use?
 In order to choose the
appropriate two-sample t-test,
we must decide if we think the
variances are the same.

 Hence we perform a preliminary


statistical test – the equal
variance F-test.
The Equal Variance F-test
 One of the fortunate properties on
statistics is that the ratio of two
variances will have an F distribution.
 Thus with this knowledge, we can
perform a simple test.

s 2 l arg er
F( n1  1,n2  1)  2
s smaller
ANOVA Terminology
 Single Factor Independent Measures Design
(One-way Design)
• Factor
Variable that is independent (manipulated) or quasi-
independent (non-manipulated, grouping)
• Independent measures
 Designates that it is a between-subjects design
• How many “levels” does the factor have?
 Levels refers to number of treatments conditions (groups)
 k = number of levels
When to Use ANOVA
 You MAY use ANOVA whenever you
have 2 or more independent groups
 You must use ANOVA whenever you

have 3 or more independent groups.


 Why can’t we just conduct a series of

t-tests (one for each pair of sample


means)?
• Answer: Alpha Inflation
Testwise and Familywise
Error Rates

Testwise α:
• The probability of making a Type I Error
on any one hypothesis test.

α is about .05 for each hypothesis test

Familywise α:
• The accumulated probability of making
a Type I Error when a series of
hypothesis tests are conducted.
 α is about ~.15 for 3 t-tests
The Logic of ANOVA
The Logic of ANOVA
 With ANOVA, we take the total
variance among all the scores in our
sample (in all conditions), and we
partition that variance into 2 parts:

1. Between Groups Variance


2. Within Groups Variance
The Logic of ANOVA
 Between groups variance:
• Differences between the group means
• The average amount by which the group
means vary around the grand mean.
 Within groups variance:
• Differences among people within the same
group.
• The average amount by which scores within
a group vary around mean of their group.
Research Problem

Training director wants to evaluate 3 different


training methods to determine whether there’s
any difference in effectiveness. The production
output of 16 trainees was summarized below.

X = 15+18+19+22+11+22+27+18+21+17+18+24+19+16+22+15
1.

16
=19 Grand mean using all data
Ho= μ1= μ2= μ3, H1= μ1, μ2, μ3 are not equal
Method 1 Method 2 Method 3
Daily 18
Prodn 15 22 24
of
16New 18 27 19
Employ 19 18 16
ees 22 21 22
11 17 15
85 105 114
Sampl ÷5 ÷5 ÷6
e 17 = x1 21 = x2 19 = x3
means
n1=5 n2 = 5 n3 = 6
 Analysis of variance is based on the comparison of 2 different estimates of
the variance, σ2 of our overall population.
 Examine the variance between the 3 sample means, 17,21 & 19.
 Examine the variance within the 3 samples themselves,(15,18,19,22,11),
(22,27.18,21,17), & (18,24,19,16,22,15).
 Compare the 2 estimates.
Hypothesis Testing with ANOVA

 Set Decision Criteria


• To find our critical value we need:
 Alpha level (.05)
 Degrees of freedom between groups

 Degrees of freedom within groups

 Decision Rule: Reject H0 if observed F

exceeds critical F
Calculation of between column variance
n X (2) X (2)-(3) [4]2 n* (5)
(3) (4) (5)
5 17 19 -2 4 20
5 21 19 2 4 20
6 19 19 0 0 0
40
Between-column variance= 40 =20
k-1

Training Method1 Training Method 2 Training Method 3


Sample Calculating
mean: x = the
17 variance within
Samplethe mean
samples
x =21 Sample mean x = 19
X-x (1) (1)2 X-x (2) (2)2 X-x (3) (3)2
15-17=-2 4 22-21=1 1 18-19=-1 1
18-17=1 1 27-21=6 36 24-19=5 25
19-17=2 4 18-21=3 9 19-19=0 0
22-17=5 25 21-21=0 0 16-19=-3 9
11-17=-6 36 17-21=4 16 22-19=3 9
70 62 15-19=-4 16
S12 = 70 = 17.5 S22= 62 = 15.5 60
n-1 n-1 S32 = 60 = 12
n-1
Within column variance = ∑( nj-1) sj2 =(4/13)(17.5)+(4/13)*(15.50)+(5/13)*(12.0)= 192/13=14.769
(nt-k)
F ratio= between-column variance = 20/14.769= 1.354
within column variance
• The denominator and numerator should be about equal if null
hypothesis is true.
•df of numerator= (no. of samples-1), df of denominator=(tot
sample size- no. of samples).
• At .05 level of significance, corresponding value from f-table is
the upper limit of acceptance region=3.81
•Hence calculated sample value of F lies in the acceptance region.
No significant difference in the effects of 3 training methods on
employee productivity.
Chi-Square (2) Test
for k Proportions
Chi square, does have some requirements:

 The sample must be randomly drawn from


the population.
 Data must be reported in raw frequencies
(not percentages);
 Measured variables must be independent;
 Values/categories on independent and
dependent variables must be mutually
exclusive and exhaustive;
 Observed frequencies cannot be too small.
2 Test for k Proportions
Hypotheses & Statistic
 1. Hypotheses Hypothesized
• H0: p1 = p1,0, p2 = p2,0, ..., pk = pk,0 probability
• Ha: Not all pi are equal
 2. Test Statistic
Observed count

Expected count
Number of
outcomes
 3. Degrees of Freedom: k - 1
 Test Basic Idea
2

 1. Compares Observed Count to


Expected Count If Null Hypothesis
Is True
 2. Closer Observed Count to
Expected Count, the More Likely the
H0 Is True
• Measured by Squared Difference
Relative to Expected Count
 Reject Large Values
 Test for k Proportions
2

Example
 As personnel director, you
want to test the perception
of fairness of three
methods of performance
evaluation. Of 180
employees, 63 rated
Method 1 as fair. 45
rated Method 2 as fair.
72 rated Method 3 as fair.
At the .05 level, is there a
difference in perceptions?
 Test for k Proportions
2

Solution
2 Test for k Proportions
Solution
H0 : Test Statistic:
Ha:

 =

n = n2 = n3 =
1

Critical Value(s):

Decision:
Reject

Conclusion:

0 2
 Test for k Proportions
2

Solution
 H0 : p 1 = p 2 = p 3 = Test Statistic:
1/3
 Ha: At least 1 is
different
  = .05
 n1 = 63 n2 = 45 n3 Decision:
= 72
 Critical Value(s): Conclusion:
2 Test for k Proportions
Solution
2 Test for k Proportions
Solution
 H0 : p 1 = p 2 = p 3 = Test Statistic:
1/3 2 = 6.3
 Ha: At least 1 is
different
  = .05
Decision:

Reject
 = .05 Conclusion:

0 5.991 2
2 Test for k Proportions
Solution
 H0 : p 1 = p 2 = p 3 = Test Statistic:
1/3 2 = 6.3
 Ha: At least 1 is
different
  = .05
Decision:
Reject Reject at  = .05
 = .05 Conclusion:

0 5.991 2
 Test for k Proportions
2

Solution
 H0 : p 1 = p 2 = p 3 = Test Statistic:
1/3 2 = 6.3
 Ha: At least 1 is
different
  = .05
Decision:
Reject at  = .05
Reject
 = .05 Conclusion:
There is evidence of a
difference in proportions
0 5.991 2
Types of statistical tests and its
characteristics
Hypothesis No. of Measurement Test Requirements
Testing samples scale
Hypotheses One Nominal Χ2
about
frequency Two or More Nominal χ2
distributions

Hypothesis One (large Interval or Z-Test N>=30, when


about means sample) ratio σ is known
One (small Interval or t-Test N<30, when σ
sample) ratio is not known
Two (large Interval or N>=30, when
Z-Test σ is known
samples) ratio
Two (small Interval or N<30, when σ
samples) ratio t-Test is not known
Two (small Interval or One-way
samples) ratio ANOVA

Variance Two or more Interval or


samples ratio F-test (or
ANOVA test)
PROBLEM
COMPANY PROFITS PROFITS
A financial analyst is
interested in whether (YR1) (YR2)
there was a significant
change in profits for Ohio Edison 218.9 361.0
utilities from one Kentucky utilities 79.4 82.3
period to another. A PSI Holdings 99.1 125.2
random sample of 11 Idaho Power 49.0 84.7
companies from Forbes
NY State E & G 171.5 157.8
500 contributed the
following data: Northeast Utilities 224.8 203.2
Southwestern 105.0 124.9
services
a. Should a test of
Pacific Corp 446.8 465.6
independence or
Scana 120.7 122.6
related samples be
used? Puget sound & 128.2 117.7
light
b. Is there a difference in Public service 124.9 148.8
profits between the 2 Colorado
years?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy