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

Hypothesis Testing Class

Hypothesis Testing Class PPT

Uploaded by

Debashis Ghosh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views

Hypothesis Testing Class

Hypothesis Testing Class PPT

Uploaded by

Debashis Ghosh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 73

Inferential Statistics

STAT 1
SUMMARY STATISTICS
SAMPLE VS POPULATION

RANDOM VARIABLE
PROBABILITY DISTRIBUTION

BINOMIAL PROBABILITY DISTRIBUTION


POISSON PROBABILTY DISTRIBUTION

Jigsaw Academy Education Pvt. Ltd.

SUMMARY STATISTICS
Why is it important for us to learn about summary statistics?
Description of a large number of data points
Generate inferences from the summary statistics
A very simple example
You work for a credit card company, and you have data on credit
card applications. You divide the data into applications from
customers who have a great payment record, and applications from
customers who have been late with payments at least 3 times in
the last year
Average salary for Group 1: $37,000. Standard Deviation: $5,000
Average Salary for Group 2: $26,000. Standard Deviation: $9,000

Jigsaw Academy Education Pvt. Ltd.

SUMMARY STATISTICS
Going beyond summary statistics
With large volumes of data :
Many trends
Multiple patterns
Some contradictory findings
How do we establish
Meaningful trends vs random noise
Relative importance or impact?
Inferential Statistics
Allows us to find statistically significant relationships
Remove noise

Jigsaw Academy Education Pvt. Ltd.

CASE STUDY
You receive customer complaints about a
courier vendor you use for delivery of
products purchased they do not seem to be
delivering on time.
You confront the vendor and they claim that
they meet industry standards, and that the
complaints are a result of isolated and oneoff situations

You compare the delivery times for random


(39) transactions to the same city between
this vendor (FastCourier) and your most
reliable courier vendor (ReliableCourier)

Jigsaw Academy Education Pvt. Ltd.

CASE STUDY
Is 6.18 different from 5.28?
Is it a big difference?
What would you conclude?

Absolute difference: 0.90 days


% Diff (relative to Reliable): 16%
Should we take another sample?
Is this the population?
Is sample size an issue?

Jigsaw Academy Education Pvt. Ltd.

CASE STUDY 2
A/B TESTING
You are testing banner ads on your ecommerce website, with changes in copy.
You run with one type of banner for 10 days, and check key KPIs (say purchase rate).
You then run second banner for next 10 days and check purchase rate
This is the data, on a daily basis.

Is Banner B better? How confident are you?

Jigsaw Academy Education Pvt. Ltd.

SAMPLE VS POPULATION
In the previous slide, we have introduced the concept of sample and
population
Examples of Populations
All applications received for credit cards from Bank XYZ
All consumers of Product Y
What others can you think of?
Examples of Samples:
All applications received in the last 3 months
Women consumers over the age of 45 that have bough Product Y
in the last 6 months
What else?

Jigsaw Academy Education Pvt. Ltd.

SAMPLE VS POPULATION
Why do we need to separate the two?
Population (or the Universe) tends to be very large, making it difficult
(or impossible) to collect and analyze data on the population
It is easier to take a subset of the population, analyze the subset, and
then make inferences about the population

The second point depends on a fundamental assumption what


is that?
Representativeness
We have to find a sample that is representative of the
population that it belongs to

Jigsaw Academy Education Pvt. Ltd.

SAMPLE VS POPULATION
Lets say we have a population of 10000 respondents to a survey,
and we want to take a sample of 500. How many samples are
possible?

Clearly, we can choose many samples from a population. A good


sample is that which is chosen:
Without bias :(not choosing only high income respondents)
Full coverage: All segments in population are correctly
represented
Nonresponse inclusive: If 20% of your population are
defaulters, your sample ideally should also have 20%
defaulters

Jigsaw Academy Education Pvt. Ltd.

HOW TO CHOOSE A SAMPLE


So how do we select a sample?
Simple random sample :
All members in a population have an equal chance of being
selected in the sample

Stratified random sampling:


Population members are first divided into groups or strata based
on meaningfulness. Then random samples are taken from each
strata

The important thing to remember while building a sample is


representativeness. We assume that the sample represents the
population, so any inferences we draw about the sample will be true
of the population

Jigsaw Academy Education Pvt. Ltd.

CASE STUDY
You work for Airline X as GM Sales. For any flight, lets assume for simplicity
that there are always 100 seats. When selling flight tickets, you could always
sell exactly 100 tickets. However, you know that in most flights, some people
will not show up, so you could maximize sales by reselling that ticket.

How do you decide how many tickets you should oversell for each flight?
Remember, if you oversell by more than the number of people who dont show, you will lose
money in terms of putting those people on other flights plus some compensation

Jigsaw Academy Education Pvt. Ltd.

RANDOM VARIABLES
AND PROBABILITY
We introduce the concept of random variables and how they apply to statistical
theory
A random variable is one that takes a numerical value whose outcome is
determined by an experiment.

Time spent by a visitor on your website


Purchase by a visitor via your website
Delivery of shipment by a courier company

Jigsaw Academy Education Pvt. Ltd.

ANOTHER EXAMPLE
Fast Courier Delivery Times:
Random variable?
Remember: its not random in the sense that you
have zero knowledge
Range of possible outcomes?
Probability of each possible outcome?

Jigsaw Academy Education Pvt. Ltd.

PROBABILITY DISTRIBUTION
Fast Courier:
In sample of 39 observations
What is probability of a random delivery taking 8 days?
8 days or more?

Jigsaw Academy Education Pvt. Ltd.

PROBABILITY DISTRIBUTION
A probability distribution therefore includes all possible outcomes of an
experiment repeated n times
A discrete probability distribution is a list of discrete outcomes ,
and a continuous distribution is a product of an experiment with continuous
possible outcomes

Jigsaw Academy Education Pvt. Ltd.

DISCRETE PROBABILITY DISTRIBUTION


FUNCTION: BINOMIAL DISTRIBUTION
The Binomial Distribution is an example of a probability distribution of a discrete random
variable
The coin toss example is most widely used, but there are many other examples:
1. Gender of babies delivered in a hospital
2. Defect in a car
The common feature across all these examples is:

1. There are only two possible outcomes: Win or Lose, 1 or 0, Male or Female
2. There are no external factors influencing the probability of each outcome over time
3. The chances of each outcome are independent of previous results

Jigsaw Academy Education Pvt. Ltd.

BINOMIAL DISTRIBUTION

n= Total number of trials/observations

x= interested out come


P=probability of success
1.
2.
3.
4.

n is fixed
Each observation represent one of the two outcomes
P is same for each outcome
Each observation is independent

Jigsaw Academy Education Pvt. Ltd.

DISCRETE PROBABILITY DISTRIBUTION


FUNCTION: BINOMIAL DISTRIBUTION
You are the Finance Manager for Company X, and you are looking at your AR
balances. Based on past data, you know that on average 40% of your customers are
more than 60 days late with payments
Lets say you have a total of 5 customers, and you want to create a contingency for
situations where > 50% of your customers are late
Probability of 0 customer being late?
Overall probability of being late (p): 0.4
Probability of not being late (1-p): 0.6
Total number of trials (n) : 5
Total successes (x); 0

If you calculate this you will get: 0.0776

Jigsaw Academy Education Pvt. Ltd.

DISCRETE PROBABILITY DISTRIBUTION


FUNCTION: BINOMIAL DISTRIBUTION

If you recalculate for 1 late customer


out of 5:
p = 0.2592

2 Late customers:
P = 0.3456

3 late customers:
P = 0.2304

4 late customers:
P = 0.0768

5 late customers:
P = 0.0120

Jigsaw Academy Education Pvt. Ltd.

So p of > 50% customers


being late = 0.2304 +0.0768
+0.0120 = 0.3192

DISCRETE PROBABILITY DISTRIBUTION


FUNCTION: BINOMIAL DISTRIBUTION
FastCourier:
If greater than 7 days = LATE;
P(LATE) = ?
What is the probability that you will see a greater
than 40% complaint rate?

Can calculate this easily in Excel using a statistical


function

Jigsaw Academy Education Pvt. Ltd.

EXCEL STATISTICAL FUNCTIONS


Formulae for calculating probabilities of random variable outcomes:
If we know that distribution of the outcomes of the random variable, we can calculate
probabilities of any specified outcome
Binomial Distribution Excel Function
= BINOM.DIST(No of successes, No of trials, Prob. Of success, Cumulative Prob)
For the prev. example:
P (exactly 40% complaint rate in a sample of 100) = Binom.dist(40,100,0.3590,false)

Jigsaw Academy Education Pvt. Ltd.

EXCEL STATISTICAL FUNCTIONS


What if cumulative = TRUE?
It generates p ( < = 40)
That is: p(0 late) + p(1 late) + p(40 late)

What about p (> 40)?

Jigsaw Academy Education Pvt. Ltd.

STAT 2
OUTLINE
POISSON PROBABILITY DISTRIBUTION
NORMAL PROBABILITY DISTRIBUTION
HYPOTHESIS TESTING

Jigsaw Academy Education Pvt. Ltd.

POISSON DISTRIBUTION
Another discrete probability distribution, that is used to model number of events
occurring in a time frame
Examples include:
1. Number of insurance claims in a month
2. Disease spread in a day
3. Number of telephone calls in an hour
4. Number of patients needing emergency services in a day

The following conditions apply to correctly use a Poisson Distribution:


Events have to be counted as whole numbers
Events are independent: so if one event occurs, it does not impact the chances of the
second event occurring
Avg frequency of occurrence for the given time period is known
Number of events that have already occurred can be counted

Jigsaw Academy Education Pvt. Ltd.

POISSON DISTRIBUTION
Poisson Probabilities are calculated as:

Where, Lambda is the mean number of occurrences in a given interval of time .


Notice here that there is no n (sample size) impact
Similar to how the Binomial probabilities are calculated, for every X and Lambda we can
calculate the Poisson Probabilities
In Excel: POISSON.DIST(X,MEAN, CUMULATIVE)

Jigsaw Academy Education Pvt. Ltd.

POISSON DISTRIBUTION
GROUP CASE STUDY
CAPACITY PLANNING:
You need 4 resources to process orders via your web-site daily. Currently you
receive an average of 392 transactions a day. Maximum transactions per
person per resource is 101. Your website cannot handle > 450 transactions in
one day.
Avg profit is Rs.120. Should you invest in an additional resource at a cost of Rs
300 per day?

Jigsaw Academy Education Pvt. Ltd.

CONTINUOUS PROBABILITY DISTRIBUTIONS


Continuous distributions are applicable when an event can take on any value within a
given range
Examples include:

1. Height of males in Bangalore


2. Average waiting time per patient at a hospital
3. Per Capita Income

The most common kind of a continuous probability distribution is the Normal


Distribution, on which we will spend some time because of its useful applications in
statistics

Jigsaw Academy Education Pvt. Ltd.

NORMAL PROBABILITY DISTRIBUTION


1. Symmetric about the (single) mean
2. Mean = Median = Mode
3. The two tails extend indefinitely and never touch the axis

What are the differences between the curves?

Jigsaw Academy Education Pvt. Ltd.

NORMAL PROBABILITY DISTRIBUTION

Jigsaw Academy Education Pvt. Ltd.

NORMAL DISTRIBUTION
Area under the curve:
The total area under a normal probability curve is always 1 . This property
allows us to think of the area as probability, and therefore we can compute
probability two values on the curve

Jigsaw Academy Education Pvt. Ltd.

NORMAL DISTRIBUTION

Jigsaw Academy Education Pvt. Ltd.

NORMAL DISTRIBUTION
We can calculate probabilities of any X given mean and std deviation
If total delivery time is normally distributed with a mean of 6 days and a std
deviation of two days, what is the probability that a random delivery takes less
than 9 days?
Use Excel:
Formula: NORM.DIST(Outcome x, Mean, Std Dev, cumulative)=
NORM.DIST(9,6,2,?)
Is this the right answer?

Jigsaw Academy Education Pvt. Ltd.

NORMAL DISTRIBUTION
Delivery will take more than 4 days?

Jigsaw Academy Education Pvt. Ltd.

NORMAL DISTRIBUTION

Delivery will take between 6 to 8 days?

HYPOTHESIS TESTING
A statistical hypothesis is an assumption about a population parameter
Hypothesis testing is a procedure to accept or reject the assumption

There are two Hypothesis


NULL HYPOTHESIS
ALTERNATE HYPOTHESIS
Typically a random sample from the population is examined
If the sample data is not consistent with the hypothesis we fail to accept
the NULL hypothesis

HYPOTHESIS TESTING
Inventory Optimization
You want to optimize inventory costs , and you are reviewing mobile electronic
equipment. You have been using a daily sales average for this category as 315,
with a std deviation of 85 (based on past data a year ago). You take a current
sample of the last 45 days to validate, and find that avg daily sales are 338. Should
you increase inventory levels?
SIMPLE ANSWERS?
Yes, data clearly shows increase in inventory levels.
No we need a larger sample before we decide

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
One way to solve this is to run a hypothesis test.
1. Set up NULL HYPOTHESIS

There is no increase in daily rate, observed differences are simply random


chance variation
2. Set up ALTERNATE HYPOTHESIS
Negation of Null: There is an increase in daily sales rate
3. Decide on a Significance level

4. Calculate Probability of observed outcome


5.Reject the null if the significance level is less than significance level

Jigsaw Academy Education Pvt. Ltd.

SAMPLING DISTRIBUTION OF MEAN


Suppose we take 40 days observations 50 times
then how many samples we are creating?

Calculate the mean of each 40 days set


What will be the mean of samples, same or different?

And plot the frequency distribution of the means


Then its called the sampling distribution of the mean

CENTRAL LIMIT THEOREM


Central Limit Theorem:
As sample size grows sufficiently large, the sampling distribution of
the means will tend towards a normal distribution (even if the underlying
population is not normal)
Mathematically:
When we select simple random samples of size n, the distribution of these sample
can be modeled means with a probability model that is


N ,

Implications : If sample size is sufficiently large (> 30), you can always use a
normal distribution as your test distribution without worrying about true
population distribution

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Probability of Observed Outcome?
Use Central Limit Theorem.
This sample is one of multiple possible samples from the population of customers,
and therefore means of all possible samples will follow a normal distribution

Given a normal distribution, we can compute probability of an observed outcome.


= NORM.DIST(338,315,85/(45^0.5),TRUE)

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
= NORM.DIST(338,315,85/(45^0.5),TRUE)
This is the probability of seeing mean less or equal to 338.
We need probability of outcomes as extreme or more extreme assuming that the null
is true
That is:
1 norm.dist(338,315,85/(45^0.5),true)

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
What if the observed probability was low?

What if the observed probability was high?

How do we decide the separation between low and high?

Low? Or High?
20%

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Cut-off : SIGNIFICANCE LEVEL (ALPHA, )
Calculated Probability: P-VALUE

IF:
P-VALUE < SIGNIFICANCE LEVEL
REJECT THE NULL HYPOTHESIS
P-VALUE > SIGNIFICANCE LEVEL
FAIL TO REJECT THE NULL HYPOTHESIS

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Significance Level usually 5%
In the inventory example:
Null Hypothesis: Daily Sales rate has not changed

Alternate Hypothesis: Daily Sales Rate has increased


Significance Level: 5%

P-Value : 1 NORM.DIST(338,315,85/45^0.5,TRUE) = 0.03475


0.035 < 0.05 so we reject the null.

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
You believe that average discounts on books is maintained around 24%. You take a
random sample of 100 books and find that average discount is 26%, with a std
deviation of 6%. Is this a substantial difference? Are your books discounted more than
expected?

NULL HYPOTHESIS:
Discounts are still averaging 24%
ALTERNATE HYPOTHESIS:
Discounts are steeper than 24%
SIGNIFICANCE LEVEL:
10%
P VALUE:
= 1- norm.dist(26,24, 6/10, true) = 0.0004
CONCLUSION?

Jigsaw Academy Education Pvt. Ltd.

Notice used
Sample std
deviation
instead of
pop. std dev

HYPOTHESIS TESTING
Types of Hypothesis Tests:
1. One Tail and Two Tail Tests
2. Large Sample (Z Tests) and Small Sample Tests (T Tests)
3. One sample and Two Sample Tests
Single Sample Z/T tests, Independent Sample T tests, Paired Sample T tests
4. Multiple sample tests
ANOVA
5. Non-parametric Tests
Chi Square Tests

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
If Alternate Hypothesis is set up as:
Sample mean not equal to population mean:
Two Tail Test
P-VALUE should be compared to SIGNIFICANCE LEVEL/2

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
You want to optimize inventory costs , and you are reviewing mobile electronic
equipment. You have been using a daily sales average for this category as 315,
with a std deviation of 85 (based on past data a year ago). You take a current
sample of the last 45 days to validate, and find that avg daily sales are 338.
Should you increase inventory levels?

Null: Stays the Same: Average daily sales are same as population i.e. 315
Alternate1: Average daily sales are STEEPER then 315
Alternate2:Two Tail Hypothesis: Average daily sales are NOT EQUAL to 315
Alpha: 5% (Same)
P-value : 1- norm.dist(338,315,85/45^0.5, true) = 0.035 (Calculated the same way)
If One Tail: 0.035 < 0.05 Reject Null
If Two Tail: 0.035< 0.025 Accept Null
Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Choosing one tail vs two tail:
Depends on the business context
For example:
1. You work for a manufacturer of cereals, and are receiving consumer complaints of
package weight being less than printed weight on your product. You take a random
sample from your production process and want to run a check. What alternate
hypothesis will you choose?

2. You are working for a parts manufacturer for an airline company, and are creating
components for engine parts. You have received specifications from the airline
company around the weight of each valve. When you run a quality check on the
finished product, what alternate hypothesis will you choose?
REMEMBER: Decide which tail test you will run before calculating p-value

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Types of Hypothesis Tests:
1. One Tail and Two Tail Tests
2. Large Sample (Z Tests) and Small Sample Tests (T Tests)
3. One sample and Two Sample Tests
Single Sample Z/T tests, Independent Sample T tests, Paired Sample T tests
4. Multiple sample tests
ANOVA
5. Non-parametric Tests
Chi Square Tests

Jigsaw Academy Education Pvt. Ltd.

STATS 3
OUT LINE

Hypothesis testing for small samples


Hypothesis testing for two samples
Multi sample test ANOVA
Non parametric test Chi Square

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Large Sample and Small Sample Tests
Is sample size > 30 Use CLT and Normal Distribution
Sample Size < 30 Use T Distribution
Suppose we have a simple random sample of size n
drawn from a Normal population with mean and
standard deviation s.

has a t distribution with n-1 degrees of freedom

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
T - TESTS
If sample size is < 30, your data may not be normally distributed.
In order to compute probability of an observed outcome when sample size < 30, use a
t- distribution or a t-test
Suppose we have a simple random sample of size n drawn from a Normal population with
mean and standard deviation s.

has a t distribution with n-1 degrees of freedom


As sample size increases and approaches 30, the t-dist
approximates a normal distribution

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
T - TESTS
You believe books are your most popular category of sales, with a 35% share of
transactions. A random sample of 10 days shows books share of total daily sales
averaging 32%, std deviation 3%. Has share of books reduced? Use a 5% level of
significance
NULL HYPOTHESIS
Share of books category = 35%
ALTERNATE HYPOTHESIS
Share of books category not equal to 35% (TWO TAIL TEST)
SIGNIFICANCE LEVEL: 5%

P-VALUE: Calculate T stat, and use Excel

T = (32 -35)/(3/(10^0.5)) = -3.16


Excel: = T.DIST(X, deg_freedom, cumulative) = T.DIST(-3.16, 9, TRUE) = 0.005

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
T - TESTS
2 parts to the T-Test in Excel:
1. Calculate Test Statistic distance measure
2. Include Test Statistic in the T.DIST function

Dont need to do that for Normal Distribution because p-values of a normal distribution
are the same irrespective of sample size
But p-values of a T-Dist depend on Sample size.

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING FOR PROPORTIONS IN


POPULATION
A coffee chain is trying to decide whether to introduce flavour or not.
From the past data they know that 558 out of 1000 customer ask for the
new flavour. This year, 265 out of a sample of 435 people asked for the
new flavours. Would you recommend the coffee chain to introduce new
flavours at .01 level of significance?
.NULL HYPOTHESIS:
The is no difference in the sample and the population
ALTERNATE HYPOTHESIS:
The proportion has increased
SIGNIFICANCE LEVEL: 0.01
P-VALUE:

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Types of Hypothesis Tests:
1. One Tail and Two Tail Tests
2. Large Sample (Z Tests) and Small Sample Tests (T Tests)
3. One sample and Two Sample Tests
Single Sample Z/T tests, Independent Sample T tests, Paired Sample T tests
4. Multiple sample tests
ANOVA
5. Non-parametric Tests
Chi Square Tests

Jigsaw Academy Education Pvt. Ltd.

CASE STUDY 2
A/B TESTING
You are testing banner ads on your ecommerce website, with changes in copy.
You run with one type of banner for 10 days, and check key KPIs (say purchase rate).
You then run second banner for next 10 days and check purchase rate
This is the data, on a daily basis.

Is Banner B better? How confident are you?

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
T - TESTS
Often, we want to test difference in sample means between two samples (not sample
vs population)
example: A/B Testing

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
T - TESTS
Independent Sample T Tests
Excel: Data \Data Analysis\ T-Test: Two Sample

Jigsaw Academy Education Pvt. Ltd.

TWO-SAMPLE T-TESTS
The test statistic is:

Assuming equal variance between the two samples.


If variances are unequal:

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
MULTIPLE SAMPLE TESTS
What if you have multiple samples?
Supposing you are checking effectiveness of click rate based on 4 different layouts
This is the data:

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
T - TESTS

Jigsaw Academy Education Pvt. Ltd.

TWO-SAMPLE T-TESTS
In the previous example, we compared two samples that had equal
observations
1.

If there are unequal observations, we can still use the t-test, but the
degrees of freedom used should be 1 less the small sample size

2.

We can also assume similar variance across the two samples, in which case
the t-stat will be simplified, but if variance is not similar, use the test for
unequal variance in Excel

Jigsaw Academy Education Pvt. Ltd.

PAIRED DIFFERENCE T-TESTS


In the previous example, we looked at
comparisons of average call time for a
random 10 calls before the project was
implemented, and a random 10 calls after
a solution was designed
In some cases, we may want to test
observations that are paired to see if
there is a true difference in their means
before and after the experiment
For example, lets say we are testing the
efficacy of a particular drug that claims
will help patients lose weight
We record average weight for 8 respondents
before and after they take the drug for 20
weeks

Jigsaw Academy Education Pvt. Ltd.

Weight
Respondent Weight Pre Post
1
162
168
2
170
158
3
184
186
4
164
155
5
172
143
6
176
161
7
159
160
8
170
135

PAIRED DIFFERENCE T-TESTS


Test statistic is:

Where d is the difference in scores. We need to calculate the mean and


standard error of the pre-post differences for each pair and then use
that for the test statistic
Lets say our hypothesis is that the drug does have a positive impact on
weight loss, and we would like to use a 95% confidence level.
How would you test the hypothesis?

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
Different types (or cases) of hypothesis testing:

1.

Distributions are not normal?

2.

Population std deviation is not known?

3.

Sample sizes are very small?

4.

Want to test a directional hypothesis : that is, sample mean > pop mean, for
ex, as opposed to sample mean not equal to pop mean?

5.

Compare two samples, not sample to a population?

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
ERRORS

Error Types
1. Reject the null hypothesis when in fact it is true - Type I Error
2. Fail to reject the null hypothesis when in fact it is not true - Type II Error

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
ERRORS
Type I Error

False Positive

Concluding that a
difference exists when it
does not

Type II Error

False Negative

Concluding that a
difference does not exist
when it does

Which is more serious?

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
ERRORS
Outcome

Not Guilty

Guilty

Convict

Type I Error

Correct Decision

Free

Correct Decision

Type II Error

Which is more serious?

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
ERRORS
Outcome

Part Ok

Part Not Ok

Throw

Type I Error

Correct Decision

Keep

Correct Decision

Type II Error

Which is more serious?

Jigsaw Academy Education Pvt. Ltd.

HYPOTHESIS TESTING
ERRORS
Size of Error?
Type I : Significance Level
Type II: Related to Power. Usually set to 20%. It is a function of sample size, sample
variance , and
What does 20% in Type II imply? You are willing to take a risk of not capturing an
impact that exists 20% of the time
Outcome

Part Ok

Part Not Ok

Throw

Type I Error (p=)

Correct Decision (p=1-)

Keep

Correct Decision (p= 1 )

Type II Error (p= )

Jigsaw Academy Education Pvt. Ltd.

You might also like