You are on page 1of 19

ENME392 Statistical Methods for Product and Processes Development

Hypothesis testing #2
Class 15 Tuesday 3/26/2013

ENME392 Statistics, Spring 2013

From Cornelia Grunwald-Kennedy: On April 4, mechanical engineering alumnus, Manuel Pablo Zuniga-Pflucker (Manolo Zuniga) will be giving a special presentation entitled Leadership Evolution Managing an International Publicly Traded Energy Company in room 1202 Martin Hall beginning at 5:00 p.m. We will have a brief reception before the presentation. This presentation may be of particular interest to students because he grew a small company that was founded by his father, and took it to the New York Stock Exchange in 2004. He will talk about what it takes to be a leader in an uncertain industry, and the new technology that they are using in oil exploration in a variety of environments. From www.enme.umd.edu: University of Maryland, College Park, graduates earn the second-highest starting salaries among students from all 50 U.S. state flagship schools, according to a recent study.

ENME392 Statistics, Spring 2013

Probability vs. Statistical Inference

Remember what we were doing?


Population Random sample

probability population statistical inference


Chapter 9, Estimation: have sample, what is the most likely value and confidence interval for the population? Chapter 10, Hypothesis testing: state a hypothesis, use the sample to either reject or affirm it
Figure adapted from Walpole. 23

sample

ENME392 Statistics, Spring 2013

The null and alternative hypotheses


Null hypothesis H0: What I want to falsify Often an equality Often the status quo Alternative hypothesis H1: What I want to prove by falsifying H0 Outcomes: 1. Reject H0 => take H1 as proven 2. Insufficient evidence to reject H0 => inconclusive Example: Criminal trial by jury H0: defendant is innocent H1: defendant is guilty beyond a reasonable doubt = to a certain degree of confidence

ENME392 Statistics, Spring 2013

Type I and Type II errors


Type I error: Rejecting H0 despite it being true Probability of doing this = level of significance = Type II error: Not rejecting H0 despite it being false Probability of doing this = but can only be assessed for specific alternative

Exercise 10.1 An allergist wishes to test the (null) hypothesis that at least 30% of the public is allergic to cheese. How can the allergist commit (a) a type I error? (b) a type II error? (a) Null hypothesis: > 30% are allergic Conclude that <30% of the public are allergic, when > 30% are allergic. (b) Conclude that > 30% of the public are allergic, when < 30% are allergic.

ENME392 Statistics, Spring 2013

Example

Exercise 10.6 The proportion of adults in a small town who are college graduates is estimated to be p = 0.6. In a sample of 15 adults, we shall not reject the null hypothesis if the number of college graduates is from 6 to 12. (a) Find . (b) Evaluate for the alternative p = 0.5. (c) Is this a good test procedure?

(a) Use the binomial distribution.


5 x=0 12 x=0

P(x < 6) = b(5;15,0.6)=0.0338 P(x > 12) = 1- b(12;15,0.6)=1-0.9729 = 0.0271


The probability of rejecting the null hypothesis if it is true is = 0.0338 + 0.0271 = 0.0609

ENME392 Statistics, Spring 2013

Example
(b) If p = 0.5, then what are we looking for? Make a sketch. H1: p = 0.5 H0: p = 0.6 This is a conceptual sketch, not an accurate one for this problem

x=6 Use the binomial distribution again.


5

x = 12

P(x < 6) = b(5;15,0.5)=0.1509


x=0

P (x 12) =

x=0

= P(6 X 12 | p = 0.5) = 0.9963 0.1509 = 0.8454

12 X

b(12; 15, 0.5) = 0.9963

(c) No. There is a large probability of error! The test cannot detect differences of 0.1 in p.

ENME392 Statistics, Spring 2013

Example
Exercise 10.7 The proportion of adults in a small town who are college graduates is estimated to be p = 0.6. In a sample of 200 adults, we shall not reject the null hypothesis if the number of college graduates is from 110 to 130. (a) Find . (b) Evaluate for the alternative p = 0.5. (c) Is this a good test procedure? (a) Use the normal approximation to the binomial distribution.

Z=
Z=

= np

= npq

n = 200; p = 0.6; q = 0.4 = 120; = 6.93

109.5 120 10.5 = = 1.515 6.93 6.93

Z=

130.5 120 10.5 = = 1.515 6.93 6.93

The probability of rejecting the null hypothesis even if its true (Type 1 error) is = 2 * P(Z < -1.515) = 2 * 0.0649 = 0.130

ENME392 Statistics, Spring 2013

Example
(b) If p = 0.5, what is ? Make a sketch!

= 100

= 120
H0: p = 0.6

H1: p = 0.5

100 x = 110 120 x = 130

Z=

= np

= npq

n = 200; p = 0.5; q = 0.5 = 100; = 7.07 = 1 - P(Z < 1.344) = 1 - 0.91 = 0.09

Z=

109.5 100 9.5 = = 1.344 7.07 7.07

(c) Not great. The probability of a type I error is actually higher, (0.13 compared to 0.061), and the probability of a type II error, while much lower (0.09 instead of 0.85), is sDll rather high.

ENME392 Statistics, Spring 2013

Relationship between concepts


Decide on limits for accepting H0, can then compute of the test. Limits and significance () are directly related Can also decide on significance and then find the limits Testing H0 at significance level is the same as computing a (1-) confidence interval on and rejecting H0 if the hypothesized 0 is outside the confidence interval P-value: smallest for which one would reject H0

ENME392 Statistics, Spring 2013

Difference between classical hypothesis testing and P-value


Classic approach sets based on how sure one wants to be about rejecting H0. Typical values are 0.05 and 0.01. Instead of just accepting or rejecting H0, one can provide the probability of rejecting H0, when H0 is true Classic State H0, H1 Fix
Choose test statistic
Compute statistic Reject H0 if in critical region P-value State H0, H1

Choose test statistic


Compute P
Make decision based on P and other information

ENME392 Statistics, Spring 2013

Hypothesis testing a made-up example


I want to show that the mean salary of a UMD graduate is greater than $100K. Lets say (unrealistically) that I know that the standard deviation is $25K. I try different sample sizes n but (unrealistically) I always obtain the same sample mean of $104K. = 25, n = 100, x = 104 H0: = 104

Sample distribution of x, given 0=100

How to compute the P-value:

Z=

x p = 1.6 / n

P = 2 CDF( Z )

ENME392 Statistics, Spring 2013

Example on two means


Exercise 10.42 Five samples were analyzed by two methods to see if there is a difference between a chemical analysis and an x-ray fluorescence analysis of iron content. Each sample was split into 2 sub-samples and the two analyses carried out (see right). Assuming that the populations are normal, test at the 0.05 level of significance whether the two methods of analysis give, on average, the same results.
X-ray 2 2 2.3 2.1 2.4 Chemical Differences 2.2 -0.2 1.9 0.1 2.5 -0.2 2.3 -0.2 2.4 0 dav -0.1 stdev(d) 0.141421

1. hypotheses: H0: = 0; H1: 0 2. two-sided test, /2 = 0.025 3. test statistic? We are told to assume that the populations are normal, so we can use the t-test.

T=

D D Sd / n

v = n 1 = 5 1 = 4 d.o.f.

t0.025 = 2.776 the two critical regions are t < -2.776 and t > 2.776

ENME392 Statistics, Spring 2013

Example on two means


4. calculate t

T=

D D 0.1 0 0.1 0.1 = = = = 1.58 sd / n 0.1414 / 5 0.1414 / 2.236 0.0632

5. decision: Since t = -1.58 is larger than t0.025 = -2.776, we cannot reject H0 The two methods give the same results (when tested at =0.05 level)

What about the P-value?

ENME392 Statistics, Spring 2013

Verification that your brains still work after Spring break


Q: If you flip a coin until a head first appears, what is the probability that this first head appears on an odd-numbered trial (i.e., on trial 1, 3, 5,)? 1. 33% 2. 50% 3. 67% 4. Do I ever wish that I had stayed in Florida A: 67% H TH TTH Probability = 0.5 Probability = 0.5*0.5 Probability = 0.53 Probability = 0.5 + 0.53 + 0.55 + 0.57 + = 2/3

Head on first: Head on second: Head on third: Head on odd trial:

ENME392 Statistics, Spring 2013

Test on Proportions

16 ENME392 Statistics, Spring 2013

Test on a Single Proportion


We are testing the null hypothesis H0: p = p0, where p is the parameter of the binomial distribution. One can use either x or

p = x/n.

For large n, use the normal approximation unless p0 is close to 0 or 1.

x np0 z= np0 ( 1 p0 )

or

z=

p p0 p0 q0 / n

x is the number of good items if you are comparing proportions of yield, or the number of defects if you are comparing proportions of defectives. n is the sample size p^ is the sample proportion p0 is the target proportion

17 ENME392 Statistics, Spring 2013

Example
Example A semiconductor manufacturer produces controllers used for automobile engines. The customer requires that the fraction defective (process fallout) at a critical manufacturing step not exceed 0.07 and that the manufacturer demonstrate process capability at this level of quality using = 0.05. The semiconductor manufacturer takes a random sample of 300 devices and finds that seven of them are defective. Can the manufacturer demonstrate adequate process capability for the customer? The parameter of interest is the fraction defective p0. 1. H0: p0 = 0.07, H1: p0 < 0.07 2. One-sided test, = 0.05 3. Since n is large, the test statistic is

z=

p p0 p0 q0 / n

18 ENME392 Statistics, Spring 2013

Example
4. calculate: n = 300, p^ = 7/300 = 0.023, p0 = 0.07, q0 = 0.93

z= =

p p0

0.023 0.07 0.047 0.047 = = = p0 q0 / n 0.07 * 0.93 / 300 0.065 / 300 0.00022

0.047 = 3.19 0.0147

5. decision: The P-value for this is small, 0.0007, much less than = 0.05, so we can reject H0 and conclude that our process meets the customer requirements.

19 ENME392 Statistics, Spring 2013

You might also like