Sunteți pe pagina 1din 118

Hypothesis Testing

Sheela.V.K

Introduction
Statistical inference involves two analysis methods: estimation and hypothesis testing, Statistics often involve a comparison of two values when one or both values are associated with some uncertainty. The purpose of statistical inference is to aid the researcher, or administrator in reaching a conclusion concerning a population by examining a sample from that population. Estimation can be carried out on the basis of sample values from a larger population (1). Point estimation involves the use of summary statistics, including the sample mean and SD. These values can be used to estimate intervals, such as the 95% confidence level Hypothesis testing enables one to quantify the degree of uncertainty in sampling variation, which may account for the results that deviate from the hypothesized values in a particular study

Analyze Phase

22

Hypothesis Testing
Our goal is to improve our process capability, this translates to the need to move the process mean (or proportion) and reduce the standard deviation. vBecause it is too expensive or too impractical (not to mention theoretically impossible) to collect population data, we will make decisions based on sample data. vBecause we are dealing with sample data, there is some uncertainty about the true population parameters. A hypothesis test converts the practical problem into a statistical problem. vSince relatively small sample sizes are used to estimate population parameters, there is always a chance of collecting a non-representative sample. vInferential statistics allows us to estimate the probability of getting a nonrepresentative sample.

Analyze Phase

33

Statistical Hypotheses A hypothesis is a predetermined theory about the nature of, or relationships between variables. Statistical tests can prove (with a certain degree of confidence), that a relationship exists. A general procedure is that of calculating the probability ofobserving the difference between two values if they really are not different. This probability is called the P value, and this condition is called the null hypothesis (H0). On the basis of the P value and whether it is low enough, one can conclude that H0 is not true and that there really is a difference. We have two alternatives for hypothesis.

The null hypothesis Ho assumes that there are no differences or relationships. This is the default assumption of all statistical tests. The alternative hypothesis Ha states that there is a difference or relationship.

Analyze Phase

44

Hypothesis Testing Risk The alpha risk or Type 1 Error (generally called the Producers Risk) is the probability that we could be wrong in saying that something is different. It is an assessment of the likelihood that the observed difference could have occurred by random chance. Alpha is the primary decision-making tool of most statistical tests.

Actual Conditions
Not Different
(Ho is True) (Ho is False)

Different

(Fail to Reject Ho)

Not Different

Correct Decision Type 1 Error

Statistical Conclusions

Type II Error Correct Decision

(Reject Ho)

Different

Analyze Phase

55

Alpha Risk Alpha ( ) risks are expressed relative to a reference distribution. Distributions include:

t-distribution z-distribution 2- distribution F-distribution

The -level is represented by the clouded areas. Sample results in this area lead to rejection of H0.

Region of DOUBT Accept as chance differences

Region of DOUBT

Analyze Phase

66

Hypothesis Testing Risk The beta risk or Type 2 Error (also called the Consumers Risk) is the probability that we could be wrong in saying that two or more things are the same when, in fact, they are different.

Actual Conditions
Not Different
(Ho is True) (Ho is False)

Different

(Fail to Reject Ho)

Not Different

Correct Decision Type 1 Error

Statistical Conclusions

Type II Error Correct Decision

(Reject Ho)

Different

Analyze Phase

77

Beta Risk Beta risk is the probability of failing to reject the null hypothesis when a difference exists.
Distribution if H0 is true Reject H0 = Pr(Type 1 error)
= 0.05 H0 value

Accept H0 = Pr(Type II error)


Critical value of test statistic

Distribution if Ha is true

Analyze Phase

88

Distinguishing between Two Samples Recall from the Central Limit Theorem as the number of individual observations increase the standard error decreases. In this example when n=2 we cannot distinguish the difference between the means (> 5% overlap, p-value > 0.05). When n=30, we can distinguish between the means (< 5% overlap, p-value < 0.05) There is a significant difference.
Theoretical Distribution of Means When n = 30 =5 S=1

Theoretical Distribution of Means When n = 2 =5 S=1

Analyze Phase

99

Delta SigmaThe Ratio between and S


Delta () is the size of the difference between two means or one mean and a target value. Sigma (S) is the sample standard deviation of the distribution of individuals of one or both of the samples under question. When / S is large, we dont need statistics because the differences are so large. If the variance of the data is large, it is difficult to establish differences. We need larger sample sizes to reduce uncertainty.

Large Delta

Large S

Analyze Phase

1010

The Perfect Sample Size The minimum sample size required to provide exactly 5% overlap (risk). In order to distinguish the Delta. Note: If you are working with non-normal data, multiply your calculated sample size by 1.1

4 0

Population

50

6 0

7 0

4 0

5 0

6 0

7 0

Analyze Phase

1111

Hypothesis Testing Roadmap

ous nu nti ta Co Da
Test of Equal Variance

Normal

1 Sample Variance

1 Sample t-test

Variance Equal

Variance Not Equal

2 Sample T

One Way ANOVA

2 Sample T

One Way ANOVA

Analyze Phase

1212

Hypothesis Testing Roadmap

s uou in ont ata C D

Non Normal

Test of Equal Variance

Median Test

Mann-Whitney

Several Median Tests

Analyze Phase

1313

Hypothesis Testing Roadmap

e but ri Att ata D


One Sample

Attribute Data
One Factor
Two Samples Two or More Samples

Two Factors

One Sample Proportion

Two Sample Proportion


Minitab: Stat - Basic Stats - 2 Proportions If P-value < 0.05 the proportions are different

Chi Square Test (Contingency Table)


Minitab: Stat - Tables - Chi-Square Test If P-value < 0.05 at least one proportion is different

Chi Square Test (Contingency Table)


Minitab: Stat - Tables - Chi-Square Test If P-value < 0.05 the factors are not independent

Analyze Phase

1414

Common Pitfalls to Avoid While using hypothesis testing the following facts should be borne in mind at the conclusion stage:

The decision is about Ho and NOT Ha. The conclusion statement is whether the contention of Ha was upheld. The null hypothesis (Ho) is on trial. When a decision has been made: Nothing has been proved. It is just a decision. All decisions can lead to errors (Types I and II). If the decision is to Reject Ho, then the conclusion should read There is sufficient evidence at the level of significance to show that state the alternative hypothesis Ha. If the decision is to Fail to Reject Ho, then the conclusion should read There isnt sufficient evidence at the level of significance to show that state the alternative hypothesis.

Analyze Phase

1515

Analyze Phase Hypothesis Testing Normal data

Test of Means (t-tests)

t-tests are used:

To compare a mean against a target. ie. The team made improvements and wants to compare the mean against a target to see if they met the target. To compare means from two different samples. ie. Machine one to machine two. ie. Supplier one quality to supplier two quality. To compare paired data. Comparing the same part before and after a given process.

Analyze Phase

1717

1 Sample t
A 1-sample t-test is used to compare an expected population mean to a target.

sam ple Minitab performs a one sample t-test or t-confidence interval for the mean.

Target

Use 1-sample t to compute a confidence interval and perform a hypothesis test of the mean when the population standard deviation, , is unknown. For a one or two-tailed 1-sample t:

H0: sample = target If p-value > 0.05 fail to reject Ho Ha: sample , <, > target If p-value < 0.05 reject Ho

Analyze Phase

1818

1 Sample t-test Sample Size

Population n=2 n=30


Can not tell the difference between the sample and the target. Can tell the difference between the sample and the target.

Targe t
X XX X X X X X X X X X X X X XX X X X XX X

SE M ean =

S n

Analyze Phase

1919

1-Sample t-test Example


1. Practical Problem: We are considering changing suppliers for a part that we currently purchase from a supplier that charges us a premium for the hardening process. The proposed new supplier has provided us with a sample of their product. They have stated that they can maintain a given characteristic of 5 on their product. We want to test the samples and determine if their claim is accurate. 2. Statistical Problem: Ho: N.S. = 5 Ha: N.S. 5

3. 1-sample t-test (population standard deviation unknown, comparing to target). = 0.05 = 0.10

Analyze Phase

2020

Example 4. Sample size:


Open the Minitab worksheet: Exh_Stat.MTW Use the C1 column: Values


In this case, the new supplier sent 9 samples for evaluation. How much of a difference can be detected with this sample?

Analyze Phase

2121

1-Sample t-test Example

Minitab Session Window


Power and Sample Size 1-Sample t Test Testing mean = null (versus not = null) Calculating power for mean = null + difference Alpha = 0.05 Assumed standard deviation = 1 Sample Size Power Difference 9 0.9 1.23748

This means we will only be able to detect a difference of only 1.24 if the population has a standard deviation of 1 unit.

Analyze Phase

2222

Example: Follow the Road Map 5. State statistical solution

P r obabi l i ty P l ot of Val ues


Normal
99 Mean StDev N AD P-Value 4.789 0.2472 9 0.327 0.442

95 90 80 70

Per cent

60 50 40 30 20 10

Are the data in the values column normal?


4.2 4.4 4.6 4.8 Values 5.0 5.2 5.4

Analyze Phase

2323

1-Sample t-test Example

Click Graphs
-

Select all 3

Click Options - In CI enter 95

Analyze Phase

2424

Session Window
Ho
One-Sample T: Values Test of mu = 5 vs not = 5

Ha

(X i X) 2 s= n 1 i =1
n

SE M ean =

S n

Variable Values

N 9

Mean 4.78889

StDev 0.24721

SE Mean 0.08240

95% CI (4.59887, 4.97891)

T -2.56

P 0.034

T-Calc = Observed Expected over SE Mean T-Calc = X-bar Target over Standard Error T-Calc = 4.7889 5 over .0824 = - 2.56 N sample size Mean calculate mathematic average StDev calculated individual standard deviation (classical method) SE Mean calculated standard deviation of the distribution of the means Confidence Interval that our population average will fall between 4.5989, 4.9789

Analyze Phase

2525

Evaluating the Results Since the p-value of 0.034 is less than 0.05, reject the null hypothesis. Based on the samples given there is a difference between the average of the sample and the desired target.

Ho

6. State practical conclusions. The new suppliers claim that they can meet the target of 5 for the hardness is not correct.

Analyze Phase

2626

Manual Calculation of 1- Sample t Lets compare the manual calculations to what the computer calculates. Calculate t-statistic from data:

X Target 4.79 5.00 t= = = 2.56 s 0.247 n 9

Determine critical t-value from t-table in reference section. When the alternative hypothesis has a not equal sign, it is a two-sided test. Split the in half and read from the 0.975 column in the t-table for n -1 (9 - 1) degrees of freedom.

Analyze Phase

2727

Manual Calculation of 1- Sample t


degrees of freedom

T - Distribution
.600 0.325 0.289 0.277 0.271 0.267 0.265 0.263 0.262 0.261 0.260 .700 0.727 0.617 0.584 0.569 0.559 0.553 0.549 0.546 0.543 0.542 .800 1.376 1.061 0.978 0.941 0.920 0.906 0.896 0.889 0.883 0.879 .900 3.078 1.886 1.638 1.533 1.476 1.440 1.415 1.397 1.383 1.372 .950 6.314 2.920 2.353 2.132 2.015 1.943 1.895 1.860 1.833 1.812 .975 12.706 4.303 3.182 2.776 2.571 2.447 2.365 2.306 2.262 2.228 .990 31.821 6.965 4.541 3.747 3.365 3.143 2.998 2.896 2.821 2.764 .995 63.657 9.925 5.841 4.604 4.032 3.707 3.499 3.355 3.250 3.169

1 2 3 4 5 6 7 8 9 10

-2.56 -2.306 /2=.025 2.306 /2 =.025

If the calculated t-value lies anywhere 0 Critical Regions in the critical regions, reject the null hypothesis. The data supports the alternative hypothesis that the estimate for the mean of the population is not 5.0.
Analyze Phase 2828

Confidence Intervals for Two-Sided t-test

The formula for a two-sided t-test is:


X t /2, n 1 s s X + t /2, n 1 n n or

X t crit SE mean = 4.788 2.306 * .0824 4.5989 to 4.9789

4.5989

4.788 9

4.978 9

Ho

Analyze Phase

2929

1-Sample t-test Exercise: Solution


Since we do not know the population standard deviation, we will use the 1 sample T test to determine if we are at target.

Analyze Phase

3030

1-Sample t-test Exercise: Solution


After selecting column C1 and setting Hypothesis mean to 32.0, click graphs and select Histogram of data to get a good visualization of the analysis. Depending on the test you are running you may need to select Options to set your desired confidence Interval and hypothesis. In this case the Minitab Defaults are what we want.

Analyze Phase

3131

1-Sample t-test Exercise: Solution Because we used the option of Graphs, we get a nice visualization of the data in a histogram AND a plot of the null hypothesis relative to the confidence level of the population mean. Because the null hypothesis is within the confidence level, you know we will fail to reject the null hypothesis and accept the equipment is running at the target of 32.0.

Hi stogram of ppm VOC


(with Ho and 95% t-confidence interval for the mean) 10 8 6 4 2 0
Ho _ X

Frequency

20

25

30

35 ppm VOC

40

45

50

Analyze Phase

3232

1-Sample t-test Exercise: Solution In Minitabs session Window (ctrl M), you can see the P-value of 0.201. Because it is above 0.05, we fail to reject the null hypothesis so we accept the equipment is giving product at a target of 32.0 ppm VOC.

Analyze Phase

3333

2 Sample t-test A 2-sample t-test is used to compare two means.


Stat > Basic Statistics > 2-Sample t

Minitab performs an independent two-sample t-test and generates a confidence interval. Use 2-Sample t to perform a hypothesis test and compute a confidence interval of the difference between two population means when the population standard deviations, s, are unknown. Two tailed test: H0: 1 = 2 Ha: 1 2

If p-value > 0.05 fail to reject Ho If p-value < 0.05 reject Ho

One tailed test: H0: 1 = 2 Ha: 1 > or < 2


Analyze Phase 3434

2-Sample t-test Example 1. Practical Problem: We have conducted a study in order to determine the effectiveness of a new heating system. We have installed two different types of dampers in home ( Damper = 1 and Damper = 2). We want to compare the BTU.In data from the two types of dampers to determine if there is any difference between the two products. 2. Statistical Problem: Ho:1 = 2 Ha:1 2 3. 2-Sample t-test (population standard deviations unknown). = 0.05 = 0.10

Analyze Phase

3535

2 Sample t-test Example 4. Sample size: Open the Minitab worksheet: Furnace.MTW Scroll through the data to see how the data is coded. In order to work with the data in the BTU.In column, we will need to unstack the data by damper type.

Analyze Phase

3636

2 Sample t-test Example

Analyze Phase

3737

2 Sample t-test Example

Analyze Phase

3838

2 Sample t-test Example

Minitab Session Window


Power and Sample Size 2-Sample t Test Testing mean 1 = mean 2 (versus not =) Calculating power for mean 1 = mean 2 + difference Alpha = 0.05 Assumed standard deviation = 1 Sample Size Power Difference 40 0.9 0.733919 50 0.9 0.654752 The sample size is for each group.

Analyze Phase

3939

Test of equal Variance (Bartletts Test)

Analyze Phase

4040

Test of Equal Variance


Test for Equal Var i ances for BTU.In
F-Test 1 D amper Test Statistic P-Value Test Statistic P-Value 1.19 0.558 0.00 0.996

Levene's Test

Sample 1

2.0

Sample 2
1 D amper

2.5 3.0 3.5 9 5 % B onfer r oni Confidence I nter vals for StD evs

4.0

10 B T U.I n

15

20

Analyze Phase

4141

2 Sample t-test Equal Variance

Analyze Phase

4242

Box Plot
Boxpl ot of BTU.In by Damper
20

15

BTU.In

10

1 Damper

5. State statistical conclusions: Fail to reject the null hypothesis 6. State practical conclusions: There is no difference between the dampers for BTUs in.

Analyze Phase

4343

Minitab Session Window


Calculated Average

(X i X) 2 s= n 1 i =1
n

SE Mean =

S n

(N1 1) + (N2-1)

Two- Sample T-Test (Variances Equal)

Number of Samples

-1.450 -0.38

0.980

Ho: 1 = 2 Ha: 1 or < or > 2

T-Calc = Observed d Expected d divided by s T-Calc = Estimate for difference Target for distance over s T-Calc = (9.91 10.14) / T-Calc = -0.235 / s

Analyze Phase

4444

Unequal Variance Example Open Minitab worksheet: 2 sample unequal variance data

Analyze Phase

4545

Normality Test
Lets compare the data in Sample one and Sample three columns.
P r obabi l i ty P l ot of S ampl e 3
Normal
99.9 99 95 90 80 70 60 50 40 30 20 10 5 1 0.1 Mean StDev N AD P-Value 4.852 3.134 100 0.274 0.658

P r obabi l i ty P l ot of S ampl e 1
Normal
99.9 99 95 90 80 70 60 50 40 30 20 10 5 1 0.1

Percent

-5
4.853 1.020 100 0.374 0.411

Mean StDev N AD P-Value

5 Sample 3

10

15

Percent

Our data sets are normally distributed.


1 2 3 4 5 Sample 1 6 7 8

Analyze Phase

4646

Test for Equal Variance


Stat>ANOVA>Test of Equal Variance

Standard Deviation of Samples

We use F-Test Statistic because our data is normally distributed. P-Value is less than 0.05, our variances are not equal.

Medians of Samples

Analyze Phase

4747

2-Sample t-test Unequal Variance

UNCHECK assume equal variances box.

Analyze Phase

4848

2-Sample t-test Unequal Variance

Box pl ot of S tack ed by C4
15

Indicate Sample Means

10 St acked

-5 1 C4 2

Analyze Phase

4949

2-Sample t-test Unequal Variance

Indi v i dual Val ue P l ot of S tacked v s C4


15

10 St acked

Indicate Sample Means

-5 1 C4 2

Analyze Phase

5050

2-Sample t-test Unequal Variance

Two-Sample T-Test (Variances Not Equal) Ho: 1 = 2 (P-Value > 0.05) Ha: 1 or < or > 2 (P-Value < 0.05)
Stat>Basic Stats> 2 sample T (Deselect Assume Equal Variance)

Analyze Phase

5151

Paired t-test

A paired t-test is used to compare the means of two measurements from the same samples generally used as a before and after test. Minitab performs a paired t-test. This is appropriate for testing the difference between two means when the data are paired and the paired differences follow a normal distribution. Use the Paired t command to compute a confidence interval and perform a hypothesis test of the difference between population means when observations are paired. A paired t-procedure matches delta responses that are dependent or related in a pair-wise () manner. This matching allows you to account for variability between the pairs usually resulting in a smaller error term, thus increasing the sensitivity of the hypothesis test or confidence interval. Ho: = o Ha: o bef aft Where is the population mean of the differences and 0 is the ore er hypothesized mean of the differences, typically zero.
Stat > Basic Statistics > Paired t

Analyze Phase

5252

Example Practical Problem: . We are interested in changing the sole material for a popular brand of shoes for children. . In order to account for variation in activity of children wearing the shoes, each child will wear one shoe of each type of sole material. The sole material will be randomly assigned to either the left or right shoe. 2. Statistical Problem: Ho: = 0 Ha: 0 3. Paired t-test (comparing data that must remain paired). = 0.05 = 0.10
1.

Analyze Phase

5353

Example 4. Sample size: How much of a difference can be detected with 10 samples?
EXH_STAT DELTA.MTW

Analyze Phase

5454

Paired t-test Example

Minitab Session Window


Power and Sample Size 1-Sample t Test Testing mean = null (versus not = null) Calculating power for mean = null + difference Alpha = 0.05 Assumed standard deviation = 1 Sample Size Power Difference 10 0.9 1.15456

This means we will only be able to detect a difference of only 1.15 if the standard deviation is equal to 1.

Analyze Phase

5555

Paired t-test Example 5. State statistical solution


Calc>Calculator

We need to calculate the difference between the two distributions. We are concerned with the delta, is the Ho outside the t-calc (confidence interval).

Analyze Phase

5656

Analyzing the Delta Following the hypothesis test roadmap, we first test the ABDelta distribution for normality.

P r obabi l ity P l ot of AB Del ta


Normal
99 Mean StDev N AD P-Value 0.41 0.3872 10 0.261 0.622

95 90 80 70

Percent

60 50 40 30 20 10 5

-0.5

0.0

0.5 A B Delt a

1.0

1.5

Analyze Phase

5757

1-Sample t-test
Stat > Basic Statistics > 1-Sample t-test

Since there is only one column, AB Delta, we do not test for equal variance per the hypothesis testing roadmap. Check this data for statistical significance in its departure from our expected value of zero.

Analyze Phase

5858

Box Plot

Minitab Session Window


Boxplot of AB Delta One-Sample T: AB Delta Test of mu = 0 vs not = 0 Variable N Mean StDev SE Mean

AB Delta 10 0.410000 0.387155 0.122429 95% CI T P (0.133046, 0.686954) 3.35 0.009

5. State statistical conclusions: Reject the null hypothesis 6. State practical conclusions: We are 95% confident that there is a difference in wear between the two materials.

Analyze Phase

5959

Paired t-Test Another way to analyze this data is to use the paired t-test command.
Stat>Basic Statistics>Paired T-test

Click on Graphs and select the graphs you would like to generate.

Analyze Phase

6060

Paired t-Test
Box pl ot of Di ffer ences
(with Ho and 95% t-confidence interval for the mean)

_ X Ho

The P-Value of from this Paired T-Test tells us the difference in materials is statistically significant.

-1.2

-0.9

-0.6 Differ ences

-0.3

0.0

Paired T-Test and CI: Mat-A, Mat-B Paired T for Mat-A - Mat-B Mean StDev SE Mean Mat-A 10 10.6300 2.4513 0.7752 Mat-B 10 11.0400 2.5185 0.7964 Difference 10 -0.410000 0.387155 0.122429 95% CI for mean difference: (-0.686954, -0.133046) T-Test of mean difference = 0 (vs not = 0): T-Value = -3.35 P-Value = 0.009 N

Analyze Phase

6161

Paired t-Test
The wrong way to analyze this data is to use a 2-sample t-test:

Minitab Session Window


Two-sample T for Mat-A vs Mat-B N Mean StDev SE Mean Mat-A 10 10.63 2.45 Mat-B 10 11.04 2.52 0.78 0.80

Difference = mu (Mat-A) - mu (Mat-B) Estimate for difference: -0.410000 95% CI for difference: (-2.744924, 1.924924) T-Test of difference = 0 (vs not =): T-Value = -0.37 P-Value = 0.716 DF = 18 Both use Pooled StDev = 2.4851

Analyze Phase

6262

Paired t-test Exercise: Solution

Because the two labs ensured to exactly report measurement results for the same parts and the results were put in the correct corresponding row, we are able to do a paired t-test. The first thing we must do is create a new column with the difference between the two test results.
Calc>Calculator

Analyze Phase

6363

Paired t-test Exercise: Solution


We must confirm the differences (now in a new calculated column) are from a normal distribution. This was confirmed with the Anderson-Darling Normality Test by doing a graphical summary under basic statistic.
Mean Median 0.0 0.2 0.4 0.6

S ummar y for TX_ MX-Diff


A nderson-Darling N ormality Test A -S quared P -V alue M ean S tDev V ariance S kew ness Kurtosis N M inimum 1st Q uartile M edian 3rd Q uartile M aximum -0.02782 -0.11644 0.45 0.222 0.22727 0.37971 0.14418 -0.833133 -0.233638 11 -0.50000 -0.10000 0.40000 0.50000 0.70000 0.48237 0.50822 0.66637

-0.50

-0.25

0.00

0.25

0.50

0.75

95% C onfidence Interv al for M ean 95% C onfidence Interv al for M edian 95% C onfidence Interv al for S tDev 0.26531

9 5 % Confidence I nter v als

Analyze Phase

6464

Paired t-test Exercise: Solution As weve seen before, this 1 Sample T analysis is found with: Stat>Basic Stat>1-sample T

Analyze Phase

6565

Paired t-test Exercise: Solution


Even though the mean difference is 0.23, we have a 95% confidence interval that includes zero so we know the 1-sample T tests null hypothesis was failed to be rejected. We cannot conclude the two labs have a difference in lab results.

Hi stogr am of TX_ M X-Di ff


(with Ho and 95% t-confidence interval for the mean) 5 4 3 2 1 0
Ho _ X

The P-value is greater than 0.05 so we do not have the 95% confidence we wanted to confirm a difference in the lab means. This confidence interval could be reduced with more samples taken next time and analyzed by both labs.

Fr equency

-0.50

-0.25

0.00 0.25 TX _MX -Diff

0.50

0.75

Analyze Phase

6666

Analyze Phase Hypothesis Testing Normal Data

Tests of Variance

Tests of variance are used for both normal and non-normal data. Normal Data 1 Sample to a target 2 Samples F-Test 3 or More Samples Bartletts Test Non-Normal Data 2 or more samples Levenes Test The null hypothesis states there is no difference between the standard deviations or variances. Ho: 1 = 2 = 3 Ha = at least on is different

Analyze Phase

6868

1-Sample Variance A 1-sample variance test is used to compare an expected population variance to a target.
Stat > Basic Statistics > Graphical Summary

If the target variance lies inside the confidence interval, fail to reject the null hypothesis. Ho: 2Sample = 2Target Ha: 2Sample 2Target Use the sample size calculations for a 1 sample t-test since they are rarely performed without performing a 1 sample t-test as well.

Analyze Phase

6969

1-Sample Variance
1. .

Practical Problem: We are considering changing supplies for a part that we currently purchase from a supplier that charges a premium for the hardening process and has a large variance in their process. The proposed new supplier has provided us with a sample of their product. They have stated they can maintain a variance of 0.10. Ho: = 0.31 Ha: 0.31

2. Statistical Problem: Ho: 2 = 0.10 or Ha: 2 0.10 3. 1-sample variance = 0.05 = 0.10

Analyze Phase

7070

1-Sample Variance 4. Sample size Open the Minitab worksheet: Exh_Stat.MTW This is the same file used for the 1 Sample t example. We will assume the sample size is adequate. 5. State Statistical solution

Stat > Basic Statistics > Graphical Summary

Analyze Phase

7171

1-Sample Variance Recall the target standard deviation is 0.31.


S ummar y for Val ues
A nderson-Darling N ormality Test A -S quared P -V alue M ean S tDev V ariance S kew ness Kurtosis N M inimum 1st Q uartile M edian 3rd Q uartile M aximum 4.5989 4.6000 0.33 0.442 4.7889 0.2472 0.0611 -0.02863 -1.24215 9 4.4000 4.6000 4.7000 5.0500 5.1000 4.9789 5.0772 0.4736

4.4

4.6

4.8

5.0

95% C onfidence Interv al for M ean 95% C onfidence Interv al for M edian 95% C onfidence Interv al for S tDev 0.1670
Mean Median 4.6 4.7 4.8 4.9 5.0 5.1

9 5 % C onfidence I nter vals

Analyze Phase

7272

Test of Variance Example


1.

Practical problem: We want to determine the effect of two different storage methods on the rotting of potatoes. You study conditions conducive to potato rot by injecting potatoes with bacteria that cause rotting and subjecting them to different temperature and oxygen regimes. We can test the data to determine if there is a difference in the standard deviation of the rot time between the two different methods.

2. Statistical problem: Ho: 1 = 2 Ha: 1 2 3. Equal variance test (F-test since there are only 2 factors.)

Analyze Phase

7373

Test of Variance Example 4. Sample size: = 0.05 = 0.10


Stat > Power and Sample Size > One-Way ANOVA EXH_AOV.MTW

Minitab Session Window


Power and Sample Size One-way ANOVA Alpha = 0.05 Assumed standard deviation = 1 Number of Levels = 2 Sample 50 0.9 0.214350 Maximum 0.654752 Size Power SS Means Difference The sample size is for each level.

Analyze Phase

7474

Normality Test Follow the Roadmap 5. Statistical solution:


Stat>Basic Statistics>Normality Test

Analyze Phase

7575

Normality Test Follow the Roadmap

Ho: Data is normal Ha: Data is NOT normal


Stat>Basic Stats> Normality Test (Use Anderson Darling)

P r obabi l i ty P l ot of R ot 1
Normal
99.9 99 95 90 80 70 60 50 40 30 20 10 5 1 0.1 Mean StDev N AD P-Value 4.871 0.9670 100 0.306 0.559

Per cent

5 Rot 1

Analyze Phase

7676

Test of Equal Variance

Stat>ANOVA>Test for Equal Variance

Analyze Phase

7777

Test of Equal Variance


Test for Equal Var i ances for R ot 1
F-Test 1 Factor s Test Statistic P-Value Test Statistic P-Value 0.74 0.298 0.53 0.469

Levene's Test

Use F-Test for 2 samples 0.7 normally distributed data.

0.8

0.9 1.0 1.1 1.2 9 5 % B onfer r oni C onfidence I nter vals for StD evs

1.3

1.4

P-Value >0.05 (.298) Assume Equal Variance


1 Factor s 2

4 Rot 1

6. Practical Solution: The difference between the standard deviations from the two samples is not significant. Analyze Phase 7878

Normality Test
Perform another test using the column Rot.
P r obabi l i ty P l ot of R ot
Normal
99 Mean StDev N AD P-Value 13.78 7.712 18 0.285 0.586

95 90 80 70

Per cent

60 50 40 30 20 10 5

The P-Value is > 0.05 We can assume our data is normally distributed.

-5

10

15 Rot

20

25

30

35

Analyze Phase

7979

Test for Equal Variance (Normal Data) Test for equal variance using Temp as factor.

Analyze Phase

8080

Test of Equal Variance


Test for Equal Var i ances for R ot
F-Test 10 T emp Test Statistic P-Value Test Statistic P-Value 0.68 0.598 0.05 0.824

Levene's Test

16

4 6 8 10 9 5 % B onfer r oni Confidence I nter v als for StD ev s

12

Ho: 1 = 2 Ha: 1 2

10 T emp

P-Value > 0.05, There is no statistically significant difference.

16

10 Rot

15

20

25

Analyze Phase

8181

Test of Equal Variance

Use F- Test for 2 samples of normally distributed data.

Analyze Phase

8282

Continuous Data - Normal

Analyze Phase

8383

Test For Equal Variances


Stat>ANOVA>Test for Equal Variance

Analyze Phase

8484

Test For Equal Variances Graphical Analysis

Test for Equal Var i ances for R ot


Temp Oxygen
Bartlett's Test

2 10 6 10

Test Statistic P-Value Test Statistic P-Value

2.71 0.744 0.37 0.858

Lev ene's Test

2 16 6 10 0 20 40 60 80 100 120 140 95% Bonferr oni Confidence Int er v als for St Dev s

p value > 0.05 shows insignificant difference between variance

Analyze Phase

8585

Test For Equal Variances Statistical Analysis

Test for Equal Variances: Rot versus Temp, Oxygen


95% Bonferroni confidence intervals for standard deviations Temp 10 10 10 16 16 16 Oxygen 2 6 10 2 6 10 3 N Lower 3 2.26029 3 1.28146 3 2.80104 3 1.54013 3 1.50012 3.55677 StDev 5.29150 3.00000 6.55744 3.60555 3.51188 8.32666 `Upper 81.890 46.427 101.481 55.799 54.349 128.862

Bartlett's Test (normal distribution) Test statistic = 2.71, p-value = 0.744 Levene's Test (any continuous distribution) Test statistic = 0.37, p-value = 0.858

Use this if data is normal and for Factors < 2 Use this if data is non normal for factors > 2

Analyze Phase

8686

Tests for Variance Exercise: Solution


First we want to do a graphical summary of the two samples from the 2 suppliers.

Analyze Phase

8787

Tests for Variance Exercise: Solution In Variable enter ppm VOC In By Variable enter RM Supplier We want to see if the 2 samples are from normal populations.

Analyze Phase

8888

Tests for Variance Exercise: Solution


The P-value is greater than 0.05 for both Anderson-Darling Normality Tests so we conclude the samples are from normally distributed populations because we failed to reject the null hypothesis that the data sets are from normal distributions.
S ummar y for ppm VOC
RM Supplier = A
A nderson-D arling N ormality Test A -S quared P -V alue M ean S tD ev V ariance S kew ness Kurtosis N M inimum 1st Q uartile M edian 3rd Q uartile M aximum 33.079 33.263 5.022 0.33 0.465 37.583 7.090 50.265 0.261735 -0.091503 12 25.000 33.250 35.500 42.000 50.000 42.088 42.000 12.038
Mean Median

S ummar y for ppm VOC


RM Supplier = B
A nderson-D arling N ormality Test A -S quared P -V alue M ean S tD ev V ariance S kew ness Kurtosis N M inimum 1st Q uartile M edian 3rd Q uartile M aximum 26.325 25.000 4.655 0.49 0.175 30.500 6.571 43.182 -0.555911 -0.988688 12 19.000 25.000 31.500 37.000 38.000 34.675 37.000 11.157

20

25

30

35

40

45

50

20

25

30

35

40

45

50

95% C onfidence Interv al for M ean 95% C onfidence Interv al for M edian

95% C onfidence Interv al for M ean 95% C onfidence Interv al for M edian

9 5 % C onfidence I nter vals


Mean Median 32 34 36 38 40 42

95% C onfidence Interv al for S tD ev

9 5 % C onfidence I nter v als

95% C onfidence Interv al for S tD ev

25.0

27.5

30.0

32.5

35.0

37.5

Are both Data Sets are Normal? Analyze Phase 8989

Tests for Variance Exercise: Solution

Analyze Phase

9090

Tests for Variance Exercise: Solution For Response enter ppm VOC For Factors enter RM Supplier Note Minitab defaults to 95% confidence interval which is exactly the level we want to test for this problem.

Analyze Phase

9191

Tests for Variance Exercise: Solution


Because the 2 populations were considered to be normally distributed, the F-test is used to evaluate whether the variances (standard deviation squared) are equal. The P-value of the F-test was greater than 0.05 so we fail to reject the null hypothesis. So once again in English: The variances are equal between the results from the two suppliers on our products ppm VOC level.
Test for Equal Var iances for ppm VOC
F-Test A Test Statistic P-Value Test Statistic P-Value 1.16 0.806 0.02 0.890

RM Supplier

Lev ene's Test

6 8 10 12 9 5 % B onfer r oni Confidence I nter vals for StD evs

14

RM Supplier

20

25

30

35 ppm V OC

40

45

50

Analyze Phase

9292

Purpose of ANOVA Analysis of Variance (ANOVA) is used to investigate and model the relationship between a response variable and one or more independent variables. Analysis of variance extends the two sample t-test for testing the equality of two population means to a more general null hypothesis of comparing the equality of more than two means, versus them not all being equal. The classification variable, or factor, usually has three or more levels (If there are only two levels, a t-test can be used). Allows you to examine differences among means using multiple comparisons. The ANOVA test statistic is:

Avg SS between S2 between = 2 Avg SS within S within


Analyze Phase 9393

What do we want to know? Is the between group variation large enough to be distinguished from the within group variation?

delta ()

(Between Group Variation)

Total (Overall) Variation Within Group Variation (level of supplier 1)

X X X X X X X X

1 Analyze Phase 9494

Calculating ANOVA
Where: g- the number of groups (levels in the study) xij = the individual in the jth group nj = the number of individuals in the jth group or level = the grand mean X Xj = the mean of the jth group or level

Total (Overall) Variation

delta ()

Within Group Variation

(Between Group Variation)

Between Group Variation

Within Group Variation

Total Variation

nj (Xj X)
j=1

(X
j=1 i =1

nj

ij X)

(X
j= i = 1 1

nj

ij

X) 2

Analyze Phase

9595

Alpha Risk and Pair-Wise t-tests The alpha risk increases as the number of means increases with a pair-wise t-test scheme. The formula for testing more than one pair of means using a t-test is:

Analyze Phase

9696

Three Samples We have three potential suppliers that claim to have equal levels of quality. Supplier B provides a considerably lower purchase price than either of the other two vendors. We would like to choose the lowest cost supplier but we must ensure that we do not effect the quality of our raw material.
File>Open Worksheet > ANOVA.MTW

Supplier A 3.16 4.35 3.46 3.74 3.61

Supplier B 4.24 3.87 3.87 4.12 3.74 4.58 4.00 4.24 3.87 3.46

Supplier C

We would like test the data to determine whether there is a difference between the three suppliers.

Analyze Phase

9797

Follow the RoadmapTest for Normality


P r obabi l i ty P l ot of S uppl i er A
Normal
99 Mean StDev N AD P-Value 3.664 0.4401 5 0.246 0.568

All three suppliers samples are normally distributed.


Supplier A P-Value 0.568 Supplier B P-Value 0.385 Supplier C P-Value 0.910

95 90 80 70

Percent

60 50 40 30 20 10 5

P r obabi l i ty P l ot of S uppl i er B
Normal
99 Mean 3.968 StDev 0.2051 N 5 AD 0.314 PP-Value l0.385 robabi i ty

95 90

P l ot of S uppl i er C
Normal
Mean StDev N AD P-Value 4.03 0.4177 5 0.148 0.910

2.5

3.0

80 70

3.5 Supplier A

4.0

4.5
99

Per cent

60 50 40 30 20

95 90 80 70

Per cent
3.50 3.75 4.00 Supplier B

10 5

60 50 40 30 20 10 5

4.25

4.50

3.0

3.5

4.0 Supplier C

4.5

5.0

Analyze Phase

9898

Test for Equal Variance Test for equal variance (must stack data first):

Test for Equal Vari ances for Data


Bartlett's Test Test Statistic P-Value Test Statistic P-Value 2.11 0.348 0.59 0.568

Supplier A

Lev ene's Test

Supplier s

Supplier B

Supplier C

0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 95% Bonfer roni Confidence Int er v als for St Dev s

Analyze Phase

9999

ANOVA Minitab
Stat>ANOVA>One-Way Unstacked

Enter Stacked Supplier data in Response.

Click on Graph, Check Box plots

Analyze Phase

100100

ANOVA What does this graph tell us?


Box pl ot of S uppl i er A, S uppl i er B, S uppl i er C
4.6 4.4 4.2 4.0 Dat a 3.8 3.6 3.4 3.2 3.0 Supplier A Supplier B Supplier C

Analyze Phase

101101

ANOVA Session Window


Normal data p-value > .05 No Difference

Stat>ANOVA>One Way Test for Equal Variances: Suppliers vs ID One-way ANOVA: Suppliers versus ID Analysis of Variance for Supplier Source ID Error Total DF 2 12 14 SS 0.384 1.641 2.025 MS 0.192 0.137 F 1.40 P 0.284

Individual 95% CIs For Mean Based on Pooled StDev Level Supplier Supplier Supplier N 5 5 5 Mean 3.6640 3.9680 4.0300 StDev 0.4401 0.2051 0.4177 ----------+---------+---------+-----(-----------*-----------) (-----------*-----------) (-----------*-----------) ----------+---------+---------+-----Pooled StDev = 0.3698 3.60 3.90 4.20

Analyze Phase

102102

ANOVA
Test for Equal Variances: Suppliers vs ID One-way ANOVA: Suppliers versus ID Analysis of Variance for Supplier Source ID Error Total DF 2 12 14 SS 0.384 1.641 2.025 Individual 95% CIs For Mean Based on Pooled StDev Level Supplier Supplier Supplier N 5 5 5 Mean 3.6640 3.9680 4.0300 StDev ----------+---------+---------+-----0.4401 (-----------*-----------) 0.2051 0.4177 (-----------*-----------) (-----------*-----------) MS 0.192 0.137 F 1.40 P 0.284

F-Calc

F-Critical

----------+---------+---------+-----Pooled StDev = 0.3698 3.60 3.90 4.20

Analyze Phase

103103

Sample Size Lets check and how much difference we can see with a sample of 5.

Power and Sample Size One-way ANOVA Alpha = 0.05 Assumed standard deviation = 1 Number of Levels = 3 Sample Size 5 Power 0.9 SS Means 3.29659 Maximum Difference 2.56772

The sample size is for each level.

Analyze Phase

104104

ANOVA Assumptions Observations are adequately described by the model. 2. Errors are normally and independently distributed. 3. Homogeneity of variance among factor levels.
1.

In one-way ANOVA, model adequacy can be checked by either of the following: Check the data for normality at each level and for homogeneity of variance across all levels. 2. Examine the residuals (a residual is the difference in what the model predicts and the true observation).
1.

1. 2. 3.

Normal plot of the residuals Residuals versus fits Residuals versus order

If the model is adequate, the residual plots will be structureless. Analyze Phase 105105

Residual Plots
Stat>ANOVA>One-Way Unstacked>Graphs

Analyze Phase

106106

Histogram of Residuals

Hi stogr am of the R esi dual s


(responses are Supplier A, Supplier B, Supplier C) 5

4 Frequency

-0.6

-0.4

-0.2

0.0 Residual

0.2

0.4

0.6

The histogram of residuals should show a bell shaped curve.

Analyze Phase

107107

Normal Probability Plot of Residuals


Normality plot of the residuals should follow a straight line. Results of our example look good. The normality assumption is satisfied.
N or mal P r obabi l i ty P l ot of the R esi dual s
(responses are Supplier A, Supplier B, Supplier C)
99

95 90 80 70

Per cent

60 50 40 30 20 10 5

-1.0

-0.5

0.0 Residual

0.5

1.0

Analyze Phase

108108

Residuals versus Fitted Values


The plot of residuals versus fits examines constant variance. The plot should be structureless with no outliers present. Our example does not indicate a problem.

R esi dual s Ver sus the Fi tted Val ues


(responses are Supplier A, Supplier B, Supplier C) 0.75 0.50 0.25 Residual 0.00 -0.25 -0.50 3.65 3.70 3.75 3.80 3.85 3.90 Fit t ed V alue 3.95 4.00 4.05

Analyze Phase

109109

ANOVA Exercise Exercise objective: Utilize what you have learned to conduct and analyze a one way ANOVA using Minitab.
1.

The quality manager was challenged by the plant director why the VOC levels in the product varied so much. The quality manager now wants to find if the product quality is different because of how the shifts work with the product. The quality manager wants to know if the average is different for the ppm VOC of the product among the production shifts. Use Data in columns ppm VOC and Shift to determine the answer for the quality manager at a 95% confidence level.

2.

2.

Analyze Phase

110110

ANOVA Exercise: Solution

Stat>Basic Stat>Graphical Summary

First we need to do a graphical summary of the samples from the 3 shifts.

Analyze Phase

111111

ANOVA Exercise: Solution We want to see if the 3 samples are from normal populations. In Variables enter ppm VOC In By Variables enter Shift

Analyze Phase

112112

ANOVA Exercise: Solution The P-value is greater than 0.05 for both Anderson-Darling Normality Tests so we conclude the samples are from normally distributed populations because we failed to reject the null hypothesis that the data sets are from normal distributions.
S ummar y for ppm VOC
Shift = 1

A nderson-D arling N ormality Test A -S quared P -V alue M ean S tD ev V ariance S kew ness Kurtosis N M inimum 1st Q uartile M edian 3rd Q uartile M aximum 33.847 32.936 4.470 0.32 0.446 39.500 6.761 45.714 0.58976 -1.13911 8 32.000 33.500 38.000 46.500 50.000 45.153 48.129 13.761

P-Value 0.446

20

25

30

35

40

45

50

95% C onfidence Interv al for M ean 95% C onfidence Interv al for M edian

9 5 % Confidence I nter vals


Mean Median 35 40 45 50

95% C onfidence Interv al for StDev

S ummar y for ppm VOC


Shift = 2

P-Value 0.334
A nderson-D arling N ormality Test A -S quared P -V alue M ean S tD ev V ariance S kew ness Kurtosis N M inimum 1st Q uartile M edian 3rd Q uartile M aximum 30.411 30.614 3.333 0.37 0.334 34.625 5.041 25.411 -0.74123 1.37039 8 25.000 31.750 35.500 37.000 42.000 38.839 37.322 10.260
Mean Median

S ummar y for ppm VOC


Shift = 3

P-Value 0.658
A nderson-D arling N ormality Test A -S quared P -V alue M ean S tDev V ariance S kew ness Kurtosis N M inimum 1st Q uartile M edian 3rd Q uartile M aximum 22.545 20.871 4.314 0.24 0.658 28.000 6.525 42.571 0.06172 -1.10012 8 19.000 22.000 28.000 32.750 38.000 33.455 33.322 13.279

20

25

30

35

40

45

50

20

25

30

35

40

45

50

95% C onfidence Interv al for M ean 95% C onfidence Interv al for M edian

95% C onfidence Interv al for M ean 95% C onfidence Interv al for M edian

9 5 % C onfidence I nter vals


Mean Median 30 32 34 36 38 40

95% C onfidence Interv al for S tD ev

9 5 % Confidence I nter vals

95% C onfidence Interv al for S tDev

20.0

22.5

25.0

27.5

30.0

32.5

35.0

Analyze Phase

113113

ANOVA Exercise: Solution First we need to determine if our data has equal variances.

Stat > ANOVA > Test for Equal Variances

Now we need to test the variances For Response enter ppm VOC For Factors enter Shift.

Analyze Phase

114114

ANOVA Exercise: Solution The P-value of the F-test was greater than 0.05 so we fail to reject the null hypothesis.
Test for Equal Var i ances for ppm VOC
Bartlett's Test Test Statistic P-Value Test Statistic P-Value 0.63 0.729 0.85 0.440

Levene's Test

Shift

4 6 8 10 12 14 16 95% Bonferroni Confidence Int erv als for St Dev s

18

Are the variances are equalYes!


Analyze Phase 115115

ANOVA Exercise: Solution


We need to use the One-Way ANOVA to determine if the means are equal of product quality when being produced by the 3 shifts. Again, we want to put 95.0 for the confidence level.

Stat > ANOVA > One-Way

For Response enter ppm VOC For Factor enter Shift Also be sure to click Graphs to select Four in one under residual plots.

Analyze Phase

Also, remember to click Assume equal

116116

ANOVA Exercise: Solution We must look at the residual plots to be sure our ANOVA analysis is valid. Since our residuals look normally distributed and randomly patterned, we will assume our analysis is correct.
R esi dual P l ots for ppm VO C
No rmal P ro b ab ilit y P lo t
99 90 P er cent 50 10 1 -10 0 Residual 10
N 24 AD 0.255 P-Value 0.698

R esid u als Versu s t h e Fit t ed Valu es


10 Residual 5 0 -5 -10 30 35 Fitted Value 40

Hist o g ram o f t h e R esid u als


4.8 Fr equency Residual -10 -5 0 Residual 5 10 3.6 2.4 1.2 0.0

R esid u als Versu s t h e Ord er o f t h e Dat a


10 5 0 -5 -10 2 4 6 8 10 12 14 16 18 20 22 24 Obser v ation Or der

Analyze Phase

117117

ANOVA Exercise: Solution Since the P-value of the ANOVA test is less than 0.05, we reject the null hypothesis that the mean product quality as measured in ppm VOC is the same from all shifts. We accept the alternate hypothesis that the mean product quality is different from at least one shift.

Since the confidence intervals of the means do not overlap between Shift 1 and Shift 3, we see one of the shifts is delivering a product quality with a higher level of ppm VOC.

Analyze Phase

118118

S-ar putea să vă placă și