Chapter 6

Large Sample Confidence Interval Estimates of the Population Mean
	Interval estimates
	Confidence bounds

Hypothesis Testing for Large Samples
Forming the null and alternative hypotheses
Determining the test statistic
Determining the p-value
Considering the difference of two population means

Type I and Type II errors

One- and Two-Sample Inference for Population Means
Small sample inference for a single mean: the t-distribution
	Pooled sample variance
	Paired difference test
Inference for the difference between two independent samples

Hypothesis Test for Proportions

Considering the Variance
	Testing one variance: c2 distribution
	Comparing two variances: F distribution
	Confidence interval estimates

Prediction Intervals

Introduction to Hypothesis Testing

Purpose
A hypothesis test allows us to draw conclusions or make decisions regarding population data from sampling data. 

One Sample Hypothesis Test and Confidence Interval Estimate
These tests are used to see if the population mean is a specified value or standard.

Two possible tests can be used
1.    The z-test assumes that:
•	the underlying distribution is normal or the Central Limit Theorem can be assumed to hold
•	the sample has been randomly selected
•	the population standard deviation is known or the sample size is at least 25.

2.     The t- test assumes that:
•	the underlying distribution is normal or the Central Limit Theorem can be assumed to hold
•	the sample has been randomly selected.

Two Independent Samples Hypothesis Test and Confidence Interval Estimate
This test is used to compare two population means.

Two possible tests can be used
1.    The z-test assumes that:
•	the underlying distribution is normal or the Central Limit Theorem can be assumed to hold
•	the samples have been randomly and independently selected from two populations
•	the population standard deviations are known or the sample size of each sample is at least 25.

2.     The t- test assumes that:
•	the underlying distribution is normal or the Central Limit Theorem can be assumed to hold
•	the samples have been randomly and independently selected from two populations
•	the variability of the measurements in the tow populations is the same and can be measured by a common variance. (There is a t-test that does not make this assumption; it is available when using Minitab.)

Some Considerations on the Logic of Hypothesis Testing
In these tests we are assuming a population distribution with a specified population mean which is stated as the null hypothesis.

In testing population means, we apply the Central Limit Theorem which specifies a theoretical distribution that can be thought of as having been formulated by the selection of all possible random samples of a fixed size n and calculating the sample mean for each sample. 

The mean of the sample means is equal to the mean of the population from which the samples were drawn. The variance of the distribution is s divided by the square root of n. (it is referred to as the standard error.)

The hypothesis test consists of the following.

•	Specify a hypothesized population mean (this statement is referred to as the null hypothesis).
•	Draw a random sample from the population and calculate the sample mean.
•	Interpret the results. Roughly speaking, determine the “relative position” on the calculated mean on the distribution of sample means. (In this chapter, use the z, t or F distributions.)  If the sample mean is “close” to the specified population mean, we do not have evidence to reject the hypothesized population mean.  

If the calculated sample mean is “not close” to the specified population mean, we conclude that our sample could not have been drawn from the hypothesized distribution, and thus, we reject the null hypothesis.

The t-Distribution

1.	The t distribution is used to perform tests on small samples when the population variance is unknown and can be estimated by the sample variance.
Note that the pdf for t is based on n, and as n changes, we get different curves for fixed values of the sample and population means and the sample standard deviation. Note the following diagram.

The normal curve is based only on the population mean and standard deviation; there is only one curve associated with the normal distribution.
Use the following link to see what happens to the t-distribution when the sample size changes. In this demo, change the number of degrees of freedom in a t-distribution to observe how the pdf changes. Compare it to the normal curve and see the convergence.
http://www.stat.tamu.edu/~west/applets/tdemo1.html
2.	Identify characteristics of the t-distribution.
•	Similar in shape to the normal distribution - bell shaped and symmetrical
•	There is more area in the tails and less in the center than the normal because we are using sample standard deviation to estimate the population standard deviation.
•	As we increase the sample size (and thus increase the degrees of freedom), the t distribution approaches the z distribution. (We get a set of curves that vary with the sample size.)
2.	Use the t-table or the MTB software to determine probabilities.
3.	Calculate confidence interval estimates of the population mean for small sample. (Examples follow.)
4.	Perform a hypothesis test for a population mean for a small sample. (Examples follow.)
5.	Calculate confidence interval estimates of the difference in two sample means. (Examples follow.)
6.	Perform a hypothesis test to determine if two population means are different based on two small samples. (Examples follow.)
7.	Use a statistical package (e.g. Minitab) or spreadsheet software to calculate confidence interval estimates and perform hypothesis tests. (Examples follow.)

EXAMPLE – Hypothesis Test Using the t-Distribution
The labels on gallon cans of paint indicate the drying time and the size of the area that can be covered in one coat. Most brands of paint indicate that, in one coat, one-gallon will cover between 250 and 500 sq. feet depending upon the texture of the surface to be painted. One particular brand of paint claimed that one gallon of its paint would cover 400 sq. ft. A random sample of 10 cans of white paint of this brand were used to paint ten identical areas using the same kind of equipment. The actual areas covered by these 10 gallons of paint follow. (Note: The sample mean is 365.2 sq. ft., and the sample standard deviation is 48.42 sq. ft.)
Area covered:  310	412	447	303	365	311	368	376	410	350
•	Does the data present sufficient evidence to indicate that the average coverage differs form the 400 sq. ft. claim? 
•	Find a 95% confidence interval estimate of the coverage for this brand.
Solution
1)	The data is as follows.

MTB > print c1 c2

Data Display
 Row   Area        C2

   1    310          
   2    412          
   3    447          
   4    303          
   5    365          
   6    311          
   7    368          
   8    376          
   9    410          
  10    350    
      
MTB > describe c1

Descriptive Statistics: Area
Variable             N       Mean     Median     TrMean      StDev    SE Mean
Area                10      365.2      366.5      362.8       48.4       15.3

Variable       Minimum    Maximum         Q1         Q3
Area             303.0      447.0      310.8      410.5

2)	State the null and alternative hypothesis and then complete the following two-tailed test as follows.
Ho: m = 400 ft.2  	(The population mean is 400 ft.2)	vs. 	
Ha: m  =/  400 ft.2  	(The population mean is not 400 ft.2  )
In MTB use:	Stat/Basic Statistics/1-Sample t
MTB > OneT 'Area';
SUBC>   Test 400;
SUBC>   GBoxplot.

One-Sample T: Area

Test of mu = 400 vs. mu not = 400

Variable          N      Mean     StDev   SE Mean
Area             10     365.2      48.4      15.3

Variable             95.0% CI            T      P
Area          (   330.6,   399.8)    -2.27  0.049

Note the following: The boxplot is helpful in assessing whether some of the test assumptions are satisfied. In this case, the data appears symmetrical.

Boxplot of Area

Conclusions
Reject the null hypothesis with p = 0.049 (a <0.05) and conclude that the coverage area is not 400 sq. ft.; it is, in fact, less than 400 sq. ft. 

It can be estimated with 95% confidence that on average, the paint covers an area that varies from 330.6 sq. ft. to 399.8 sq. ft. 

Example:  Two Sample t-Test

Independent samples are selected from two mines (Mine A and Mine B). The heat producing capacity of each sample is measured in millions of calories/ton. 
•	Test to see if the capacity is the same for both mines. 
•	Construct a 95% CI estimate in the difference in capacity.

MTB > print c1 c2

Data Display

 Row      MA      MB

   1    8130    7960
   2    8260    7880
   3    8340    8000
   4    8070    8040
   5    8350    7920
   6            7840

MTB > describe c1 c2

Descriptive Statistics: MA, MB

Variable             N       Mean     Median     TrMean      StDev    SE Mean
MA                   5     8230.0     8260.0     8230.0      125.5       56.1
MB                   6     7940.0     7940.0     7940.0       74.8       30.6

Variable       Minimum    Maximum         Q1         Q3
MA              8070.0     8350.0     8100.0     8345.0
MB              7840.0     8040.0     7870.0     8010.0

State the null and alternative hypothesis and then complete the following two-tailed test as follows.
Ho: mA = mB 	(The population means for the two mines are equal) 	vs. 	
Ha: m A  =/  mB 	(The population means for the two mines are not equal)
In Minitab use:  Stat> Basic Statistics > 2-sample t

MTB > TwoSample 'MA' 'MB';
SUBC>  GDotplot;
SUBC>  GBoxplot.

Two-Sample T-Test and CI: MA, MB

Two-sample T for MA vs MB

    N      Mean     StDev   SE Mean
MA  5      8230       125        56
MB  6    7940.0      74.8        31

Difference = mu MA - mu MB

Estimate for difference:  290.0

95% CI for difference: (133.6, 446.4)

T-Test of difference = 0 (vs not =): T-Value = 4.54  P-Value = 0.004  DF = 6

Results of this analysis should be written up using the format described in the text.

1)	Null Hypothesis
Ho: mA = m B
	[The heat producing capacity of the mines is equal.]

2)	Alternate Hypothesis
Ha: m A =/ m B
	[The heat producing capacities of the mines are not equal.]

3)	Test Statistic

The reference distribution is a t- distribution:  t n1+n2 - 2

4)	Calculated t value (from 3)

t-value = 4.54  

5)	The critical value of t with df = 9 is 1.833. This value can be found in the t-table or using the software.

	Note the calculated value of t is greater than the critical value of t.
		4.54 > 1.833

	Thus, reject the null hypothesis (with p < 0.001). Conclude that the heat producing capacity of mine A is different from that of mine B. Mine A seems to have a greater heat capacity.

Check the assumptions of the t-test.
An examination of the following plots is an informal way to check the assumption of equal variances. Although the variance of MA seems a bit greater than that of MB, there is no clear contradiction to this assumption. The F-test for the differences in variances should be used to confirm this observation.

Dotplots of MA, MB

Boxplots of MA, MB

Inferences About A Population Variance (the c2 Test)

Application
The chi square (c2) distribution is used to determine if a population variance meets a specified standard or takes on a particular value.

Examples
•	Precision of an instrument is must provide an unbiased reading with a small error of measurement.
•	Machined parts in a manufacturing process must be produced with minimum variability to reduce the out of size and defective parts.

The c2-Distribution
Assume that a random sample of n scores is independently selected from a normal population. Each score is transformed into a z score; this z score is then squared, and the squared z scores are summed. The sum is referred to as c2 .
	
If many such random samples are drawn from a normal population, and c2 is calculated for each sample, the sampling distribution will have a probability density that depends on the sample size, specifically the degrees of freedom. Thus, the  distribution is actually a family of distributions with the following characteristics:
•	It takes on only positive values
•	It is generally positively skewed, except for very large sample sizes (n > 100) and then the distribution approaches the normal distribution
•	The mean of the distribution is n
•	The variance of the distribution is 2n.
 
The equation of the density is given by the following. However, the appendix of the text gives critical values of c2 for various degrees of freedom.

  for x>0

Example 1
Assume we have n = 16 measurements, and thus, the df = v = 16-1 = 15

Using the table with the appropriate df, we find:	 
P(c2 > 24.9958) = .05.
P(c2 < 24.9958) = .95

Note that the ratio of the numerator of a sample variance (where samples were selected from a normal population) to its population variance also has a chi-square distribution, distributed on n-1 rather than n degrees of freedom.

This result is used to standardize s2 for the hypothesis test concerning a population variance.

Note since s2 estimates s  2:
•	If H0 is true and s 2 = so 2 then s2/ so 2  1 and thus, X2  = n - 1.
•	If H0 is not true and s 2 > so 2 then s2/ so 2 > 1 and thus, X2  > n - 1.
•	If H0 is not true and s 2 < so 2 then s2/ so 2 < 1 and thus, X2  < n - 1.

Hypothesis Test for One Variance
The test assumes that the sample was randomly selected from a normal population.
1.	Formulate the null and alternate hypotheses.
H0:	s2 = so2
Ha:	s2 > s0 2	[Note that we could also use s2 < sa 2  or   s2 =/ sa 2]

2.	Calculate  X2.
X2   =  (n-1)s2/ s0 2

3.	Reject the null hypothesis when the calculated value falls outside the region defined by the table value,  
c2  (i.e. X2 > c2a  in this case).

Example- Hypothesis Test for One Variance
A sample of 10 concrete specimens is gives a mean compressive strength of 312 kg with s2 = 195kg/cm2. Assume the specifications require s2 = 100 kg/cm2. Does the population from which are sample is drawn meet specifications? (Ref. Mendenhall and Beaver)
H0:	s2 = 100
Ha:	s2 > 100	

X2  = 9(95)/100 = 17.55 > 16.919 (from table using a = 0.05 with v = 10-1=9)

Thus, reject H0 and conclude that s2 > 100, the concrete strength of the population exceeds the specification.

Confidence Interval Estimate of the Variance
A 95% confidence interval estimate of the population variance can be estimated using the following.

	(n-1)s2/ c2.05  <  s2  <  (n-1)s2/ c2.95

It is assumed that the sample is drawn from a normal population.

Example – Estimate the Variance
Estimate the variance of impurities for example 2 (95% confidence interval estimate).
 <   a 2   <  

The interval estimate for s2 is [103.7, 527.8] kg/cm2

Try this problem.
A lapping process that is used to grind certain silicon wafers to the proper thickness is acceptable only if , the population standard deviation of the thickness of dice cut from the wafers, is at most 0.50 mil. Use the 0.05 level of significance to test the null hypothesis s = 0.50 against the alternative of s > 0.50 mil. Assume 15 dice cut from such wafers have a standard deviation of 0.64 mil. [Solution: do not reject since 22.94 is less than 23.685]

Testing The Equality Of Two Variances (The F Test)

Application
This test is used:
•	to test assumption of  equal variances that was made in using the t-test
•	when there is an interest in actually comparing the variance of two population

The F-Distribution
Assume we repeatedly select a random sample of size n from two normal populations.
Consider the distribution of the ratio of two variances:	F = s12/s22.
The distribution formed in this manner approximates an F distribution with the following degrees of freedom:
	v1 = n1 - 1 and 	v2 = n2 - 1	

The equation of the density is given by the following

   for x>0 and f(x)=0 otherwise

F-Table
The F table can be found in the appendix of our text. It gives the critical values of the F-distribution which depend upon the degrees of freedom in the numerator and the denominator.

Example – the  F- Table
Assume that we have two samples with
	n1 = 7 		and 	n2 =10
	df = 7 - 1 = 6 	and 	df = 10 - 1 = 9

Let	v = F(6,9)  where 6 is the df from the numerator and 9 is the denominator df.

Using the table with the appropriate df, we find :	 P(v < 3.37) = 0.95.

Hypothesis Test to Compare Two Variances
1.	Formulate the null and alternate hypotheses.
H0:	s12 = s 22
Ha:	s 12 > s 22	[Note that we could also use s 12 < s 22 or s 12 =/ s 22]

2.	Calculate the F ratio.
F  = s12/s22.  where s1 is the largest or the two variances.

3.	Reject the hypothesis of equal population variances (H0) if F(v1-1,v2-1) > F   [or F/2 in the case of a two tailed test]

Example - Comparing Two Variances
The variability in the amount of impurities present in a batch of chemicals used for a particular process depends on the length of time that the process is in operation.

Suppose a sample of size 25 is drawn from the normal process which is to be compared to a sample of a new process that has been developed to reduce the variability of impurities.

	Sample 1	Sample 2	
n	25	25	
s2	1.04	0.51
	
The null and alternate hypotheses are as follows.
H0:	s12 = s22
Ha:	s 12 > s 22	

F(24,24)  = s12/s22 =  1.04/.51 = 2.04

Assuming a = 0.05

F0.05 = 1.98 < 2.04

Thus, reject H0 and conclude that the variability in the new process (Sample 2) is less than the variability in the original process.

Confidence Interval Estimate of the ratio of population variances
A confidence interval estimate of the ratio of population variances can be estimated using the following.

	[s12/s22]*[1/F(v1,v2)] < a 12/a22 < [s12/s22]*[F(v1,v2)]

Example – Confidence Interval Estimate for Two Variances
Estimate the variance of impurities for previous example.

  <  a 12/a22  < 

1.3 	< a 12/a22 < 4.04

We estimate that the reduction in variance of impurities to be a large as 4.04 to 1 or as small as 1.03 to 1

Try this problem
A manufacturer wishes to determine whether there is less variability in the silver plating done by Company 1 than that done by Company 2. Independent random samples yield the following results. Do the populations have different variances? [Solution: reject H0 since 3.14 > 2.82]

	Sample 1	Sample 2	
n	12	12	
s2	0.035 mil	0.062 mil	

Minitab Example of the Equality of Two Variances
The following example is from our text and compares the hardness uniformity for two different types of steel. You should see the text for the appropriate way to write up the results of the following MTB analysis.

MTB > print c1 c2

Data Display
 Row  Heat Trt  Cold Rolled

   1      32.8         21.0
   2      44.9         24.5
   3      34.4         19.9
   4      37.0         14.8
   5      23.6         18.8
   6      39.1             
   7      39.5             
   8      30.1             
   9      29.2             
  10      19.2             

MTB > describe c1 c2

Descriptive Statistics: Heat Trt, Cold Rolled

Variable             N       Mean     Median     TrMean      StDev    SE Mean
Heat Trt            10      32.98      33.60      33.21       7.75       2.45
Cold Rol             5      19.80      19.90      19.80       3.52       1.57

Variable       Minimum    Maximum         Q1         Q3
Heat Trt         19.20      44.90      27.80      39.20
Cold Rol         14.80      24.50      16.80      22.75

In Minitab, use: Stat>Basic Statistics>2 Variances

MTB > %VarTest 'Heat Trt' 'Cold Rolled';
SUBC>   Unstacked.

Test for Equal Variances

Level1     Heat Trt
Level2     Cold Rolled
ConfLvl    95.0000
 
Bonferroni confidence intervals for standard deviations
 
  Lower     Sigma     Upper     N  Factor Levels

 5.07017   7.75110   15.6080    10  Heat Trt   
 1.97025   3.51923   12.1750     5  Cold Rolled

F-Test (normal distribution)
 
Test Statistic: 4.851
P-Value       : 0.143

Levene's Test (any continuous distribution)
Test Statistic: 2.759
P-Value       : 0.121

Test for Equal Variances: Heat Trt  vs Cold Rolled

MTB > 

 

Summary Of Hypothesis Tests Re Population Means

	Hypothesis	Test Statistic	Confidence Interval Estimate	
One Sample Hypothesis Test				
 s is known

(n>25)	Ho: m = #

Ha: m =/ #
or    m > #
or    m < #

s is unknown	Ho: m = #

Ha: m =/ #
or    m > #
or    m < #

Paired Samples				
	
Find the difference in the paired values and treat the difference scores as one sample.
			
Two Independent Samples Hypothesis Test				
s is known

(n>25)	Ho: m1 = m 2
Ha: m 1=/ m 2
or    m 1> m 2
or    m 1< m 2

		
s is unknown	Ho: m1 = m 2

Ha: m1 =/ m 2
or    m1 > m 2
or    m 1< m 2