Section 4 - Analyze Phase
Section 4 - Analyze Phase
Section 4 - Analyze Phase
Learning Objectives
It is a graphical or a tabular representation that displays the number of observations within a given interval.
The interval size depends on the data being analyzed and the goals of the analyst.
Interval
size
Data Goals
Frequency Distribution
Example: Traders use frequency distributions to check the price actions and identify trends.
Probability Distribution
The probability of an event refers to the likelihood that the event will occur.
In a statistical experiment, the sum of probabilities for all possible outcomes is equal to one.
A probability distribution is a table or an equation that links each possible value of a random
variable with its probability of occurrence.
Types of Probability Distributions
Discrete Continuous
probability probability
distribution distribution
Discrete Probability Distribution
The probability distribution of a discrete random variable can always be represented by a table.
1 0.50
2 0.25
Continuous Probability Distribution
• Y = F(X)
Probability density • Y ≥ 0 for all values of x
function (PDF)
• The total area under the curve = 1
Continuous Probability Distribution
It is impossible to figure out the probability of any one tree measuring exactly 70 inches.
Continuous Probability Distribution
69.9 inches
These are common distributions that relate to each other in interesting ways.
Types
Multinomial distribution
Discrete Probability Distribution: Types
Hypergeometric distribution
Multinomial distribution
Poisson distribution
Discrete Probability Distribution: Types
Hypergeometric distribution
Multinomial distribution
Poisson distribution
Discrete Probability Distribution: Types
Hypergeometric distribution
Multinomial distribution
Poisson distribution
Discrete Probability Distribution: Types
Multinomial distribution
Poisson distribution
Discrete Probability Distribution: Types
Hypergeometric distribution
Multinomial distribution
F distribution T distribution
Continuous Probability Distribution
T distribution
F distribution Most outcomes will be within three standard deviations of the mean.
Continuous Probability Distribution
T distribution
• Z = The z-score (Standard Score)
• X = The value to be standardized
• μ = mean
F distribution • σ = The standard deviation
Continuous Probability Distribution
or
T distribution
It is used to draw inferences about the process or population by modeling patterns of data.
The objective is to move from only describing the nature of the data to the ability infer
meaning from data as to what will happen in the future.
Inferential Statistics: Types of Error
There are four types of error contributes to uncertainty when trying to infer with data.
Bias in sampling
Lack of measurement validity
Inferential Statistics: Types of Error
Error in measurement Error in the measurement of the samples like MSA or GR&R
Lack of measurement validity Error in the measurement does not measure what it is intended
to measure
Inferential Statistics: Example
Assume that you visit a supermarket and select 100 shoppers for a survey.
These shoppers are the representative sample of all customers.
Ask them if they like a particular brand of shampoo and then record their responses.
Inferential Statistics: Example
Shampoo
brand
OR
In case of inferential statistics, you take data from samples and generalize about a population.
Inferential Statistics
Inferential statistics
Calculate a z-score or conduct a post-hoc test to make inferences about the population.
Inferential statistics use statistical models to compare your sample data with other samples.
Most research uses statistical models such as ANOVA, regression analysis, and various other
models to draw conclusions.
Central Limit Theorem
It states that the sampling distribution of the sample means tend to be a normal
distribution as the sample size gets larger.
The average of the sample means will be similar to the actual population mean.
Central Limit Theorem: Importance
The central limit theorem helps produce a distribution that approximates a normal distribution
if the sample size is large enough.
Central Limit Theorem: Importance
The central limit theorem also allows for the precision of the estimates.
Choose the right hypothesis test for the discrete data type and
continuous data type
Basics of Hypothesis Testing
Improves process capability by moving the process mean and reducing the standard
deviation
Hypothesis testing avoids the high costs of experimental efforts by using existing data.
A confidence interval refers to the probability that a population parameter will fall
between two set values for a certain proportion of times.
Confidence Level
95% or 99%
The percentage of
A range of values that likely
probability that the
would contain an unknown
confidence interval would
population parameter
contain the true population
parameter
”
(confidence intervals) contain the true population parameter.
Confidence Interval
Confidence intervals help determine the likely range of the population parameter.
Example
95% confidence interval is 5 +/-2
µ1 µ2
Sample 1 Sample 2
µ1 µ2
Sample 1 Sample 2
• The confidence established statistically has an effect on the necessary sample size.
• The ability to detect a difference is directly linked to sample size.
Significant Difference: Mean
Consider two different sample size for mean and test both them to check if they are similar or
not and see how this would impact the assumption about mean.
X Bar X Bar
Statistical Inferences and Confidence
Population
Population
X-Bar
• How close do you think the true mean (m) is to your estimate mean, X-Bar?
• How certain do you need to be about conclusions we make from your estimates?
Statistical Inferences and Confidence
As you tighten your estimate of the mean, the risk of being wrong increases.
Population
X-Bar
To be more confident in your conclusions, relax the range in which the true mean lies.
Detecting Significance
The two types of significant differences, practical and statistical, must be well
understood.
Failure to tie these two differences together is one of the most common
errors in statistics.
Variation Reduction
Mean Shift
How much of a shift in the mean will offset the cost of making a change to the process?
Detecting Significance
Variation Reduction
Mean Shift
• The larger the delta, the smaller the necessary sample will be.
• The smaller the delta, the larger the sample size.
Hypothesis Testing
A single die is altered in some form to make a certain number appear more
often that it rightfully should.
If we threw the die five times and got five one’s, what would you conclude?
Dice Example
• P (One 1) = 0.1667
We can take a 0.1% chance of being wrong about hypothesis that the die was loaded.
Statistical Hypothesis Test
Statistical tests can prove that a relationship exists with a certain degree of confidence.
Types of Hypothesis
• Represented by Ho • Represented by Ha
• There is no difference or • There is a difference or
relationship relationship
• P-value is greater than 0.05 • P-value is lesser than 0.05
With an assumption that the null If the null hypothesis is rejected,
hypothesis is true, you can only you have data that supports the
reject or fail to reject the null alternative hypothesis.
hypothesis.
Steps for Hypothesis Test
Any differences between observed data and claims made under the null
hypothesis may be real or due to chance.
Probability
P-value
Observed data
Hypothesis tests determine the probabilities of these differences occurring solely due to
chance and call them P-values.
P-Values
The alpha level of a test (level of significance) represents the yardstick against
which P-values are measured.
1% 5% 10%
Decision Risks
Type I error
Decisions
X
More hesitant to make a Overlooking an X
mistake about claiming which is never
the significance revealed
Alpha Risk: Formula
T-distribution Z-distribution
χ2-distribution F-distribution
Alpha Risk
Region of Region of
DOUBT DOUBT
Beta and sample size are very closely related. When calculating sample size, enter the
power of the test which is one minus beta.
Power = 1 - β
This establishes a sample size that will allow the proper overlap of distributions.
Beta Risk
If two populations' means differ by a very small amount, then we are likely to conclude
that the two populations are the same.
Beta only comes into play if the null hypothesis truly is false.
The more false it is, the greater your chances of detecting it, and the
lower the beta risk.
The power of a hypothesis test is its ability to detect an effect of a given magnitude.
Avoid Common Pitfalls
Actual Conditions
• The decision is about Ho and not Ha.
Not Different Different
(Ho is True) (Ho is False) • Check whether the contention of Ha was upheld.
• Ho is on trial.
Not Different Correct Type II
Conclusions
Actual Conditions
• If the decision is to Reject Ho, then there is sufficient
Not Different Different
(Ho is True) (Ho is False) evidence at the α level of significance to prove the
alternative hypothesis.
Not Different Correct Type II
Conclusions
Statistical
The power of a hypothesis test is the probability of not making a type II error.
Power of a Hypothesis Test
It is the difference between the value specified in the null hypothesis and the true
value for a population parameter.
120 100
The null hypothesis is not rejected when it is actually false, which leads to a type II error.
α α
Significance level
Sample Size
Large Delta 𝛅
Large σ
The Ratio between 𝛅 and S
Large Delta 𝛅
Large σ
The Perfect Sample Size
One could say a sample of 30 is perfect, but that may be too many.
The right sample is not known without the test.
Typical Questions on Sampling
A Well, that depends on the size of your delta and standard deviation.
Typical Questions on Sampling
A Well, that depends on the size of your delta and standard deviation.
Typical Questions on Sampling
A No, not if you took the correct number of samples the first time.
Hypothesis Testing Roadmap: Decision Tree
Decision Tree
Continuous Y, Discrete X
Y Continuous, X Discrete
For example, the sales team has improved. They want to compare the new mean against
a given target to see if they met the target.
Tests of Means (T-Tests)
Compare
Tests of Means (T-Tests)
Paired data can be compared using the effectiveness of a team before and
after the training.
Analysis of variance or ANOVA is used when it is necessary to compare more than two means.
Practical Analysis
External Internal
80.3 85.8
84.1 83.2
81.5 84.4
85.5 83.4
This is the observed (collected) 83.7 86.0
sample data set. 85.2 80.6
81.3 83.1
88.2 88.0
79.6 86.9
84.7 84.3
F-Test
In an f-test, the test statistic has an f-distribution under the null hypothesis.
It is used to:
Example: The hypothesis that a proposed regression model fits the data well
One-Sample T-Test
population
distribution
39 35
sample 36 41
data 41 40
40
44
This test value is a known or hypothesized value of the mean in the population.
One-Sample T-Test
Use a one-sample t-test to perform a hypothesis test of the mean when the
population standard deviation (σ) is unknown.
• Look for the region in which we can be 95% sure our true population mean will lie
• Use calculated average, standard deviation, number of trials and a given alpha risk of .05
The target must fall within the confidence interval of the sample mean.
One-Sample T-Test
P-value: The probability of obtaining results while assuming that the null
hypothesis is correct
Target
• Process mean and the desired target are not the same,
but they may be within an acceptable tolerance
S
SE Mean =
√n
One-Sample T-Test: Sample Size
Target
When sample size is two, one cannot
tell the difference between the sample
and the target
Sample size 2
• The spread of the distribution of averages from samples of 2 will create uncertainty
• 95% of the area under the curve of a normal distribution falls within +/-2 standard
deviations
o If you selected an alpha of 5%, then the confidence interval would be 95%
• The target value falls within +/-2 standard deviations of the sampling distribution
• The target appears outside the 95% confidence interval of the mean
One-Sample T-Test: Sample Size
Target
S
SE Mean =
√n
Two-Sample T-Test
The difference in the hypothesis for the two-tailed test vs. the one-tailed test:
Step 1
Step 2 Step 3
If the power is close to 1, the hypothesis test is very good at detecting a false null hypothesis.
Beta is generally set at 0.2 but may also be set to smaller values.
Two-Sample T-Test: Example
Step 4
Normality Test
Probability Plot
Paired T-Test
delta
(δ) • A paired t-test is performed to compare the means of two
measurements from the same or identical samples
Perform a
Compute a hypothesis test of
confidence the difference
interval between
population means
Paired T-Test
It allows you to account for variability between the pairs usually resulting in a smaller error term.
Analyzing and
modeling the
relationship
Response variable (Y) Independent variables (Xs)
ANOVA
Extends a two-sample t-test
Two-sample t-test
Tests for equality of two population means
Purpose of ANOVA
delta
(Between Group Variation)
(δ)
Total (Overall)
Variation
μ1 μ2
Calculating ANOVA
Total(Overall) Variation
delta
(δ)
𝑔 𝑔 𝑛𝑗 𝑔 𝑛𝑗
2 2 2
𝑛𝑗 𝑋𝑗 − 𝑋ധ 𝑋𝑖𝑗 − 𝑋ത 𝑋𝑖𝑗 − 𝑋ധ
𝑗=1 𝑗=1 𝑖=1 𝑗=1 𝑖=1
A t-test cannot be used to evaluate a series of means, because the alpha risk
increases as the number of means increases.
Formula: 1 – (1 – α)k
1 – (1 – 0.05)7 = 0.30
A new start-up has recently purchased an office and wants to get the carpeting done for all the
floors. Three carpet suppliers claim that their carpets are equal in levels of quality and durability.
Test the data to determine whether there is a difference between the three suppliers.
Test for Normality
Compare the P-values. All three suppliers’ samples are Normally Distributed.
Independent samples:
Wear of two tire brands, one brand
Require independent
on car A and one on car B
random samples Example
Equal vs. Unequal Variances
If inequality is assumed, when the variances are equal, we get a slightly conservative
approach where precision in estimation is lost.
Random Sampling
Data is measured on
any scale
Nonparametric tests
can be applied when:
One- and
One-Sample One-Sample Two-Sample Chi-Square
Sign Test Wilcoxon Test Proportion Test
Tests
Mann-Whitney Test
Males Females
Males Females
Distributions
overlay
Count perfectly Count
The null hypothesis for this test is that the two populations are equal.
Kruskal-Wallis Test
It compares the medians of two samples. It is best suited for small sample sizes.
Gr 1
Gr 2
The null hypothesis for this test is that the medians for both samples are the same.
Friedman Test
It is used to test the differences between groups with ordinal dependent variables.
15
It is best suited for instances The null hypothesis is that there
Response
where the same parameter is 10
are no differences between the
measured under different variables measured under
5
conditions on the same subject. different conditions.
0
Direct Mail Magazine Newspaper
Ads
One-Sample Sign Test
It is a nonparametric hypothesis test that determines if there is any difference between the
median of a non-normally distributed data set and a reference value.
The data should be taken from two samples that are paired.
One-Sample Sign Test
The null hypothesis for this test is that the median of a distribution is equal to a
hypothesized value.
Median of a distribution
= A hypothesized value
One-Sample Wilcoxon Test
It is used to compare the median of the population with the hypothesized median.
The null hypothesis states that the population median is equal to the hypothesized median.
One-Sample Proportion Test
The null hypothesis states that the population proportion is equal to the
hypothesized proportion.
Two-Sample Proportion Test
Two-Sample
Proportion Test
It is used to
determine whether
the proportions of
two separate
samples differ.
Chi-Square Test
Goodness of Fit
Chi-Square Test of Independence
It can be used when you want to check how well a sample distribution of one
variable fits the population distribution.
It can be used when you have a variable from the population and would like
to compare the sample variable with the population variable.
Chi-Square Cross-Tabulation Test
Stem 8 7 11 39
Soc. Sci. 11 41 13 9
Humanities 9 11 25 19
Interdisciplinary 15 9 21 14
Stem 8 7 11 39
Soc. Sci. 11 41 13 9
Humanities 9 11 25 19
Interdisciplinary 15 9 21 14
• Data values of two or more categorical values are displayed in a contingency table.