Skip to content

MANE 3332.05

Lecture 24

Agenda

  • Continue Chapter 9 lecture
    • Resume with Connection to confidence intervals and p-values for Case 1
  • Chapter 8, Case 3 Quiz (assigned 11/18/2025, due 11/20/2025)
  • NEW: Chapter 9, Case 1 2-sided Practice Problems (assigned 11/20/2025, due 11/25/2025)
  • NEW: Chapter 9, Case 1 Lower Practice Problems (assigned 11/20/2025, due 11/25/2025)
  • NEW: Chapter 9, Case 1 Upper Practice Problems (assigned 11/20/2025, due 11/25/2025)
  • Attendance
  • Questions?

Handouts


Week Tuesday Lecture Thursday Lecture
12 11/18 - Chapter 9 (part 1) 11/25 - Chapter 9, Case 1
13 11/25 - Chapter 9, Case 2 11/27 - Thanksgiving Holiday (no class)
14 12/2 - Chapter 9, Case 3 12/4 - Linear Regression
15 12/9 - Review Session 12/11 - Study Day (no class)

The final exam for MANE 3332.05 is Thursday December 18, 2025 at 1:15 - 3:00 PM.



Introduction to Hypothesis Testing

Decision Making for a Single Sample

  • Inferential statistics consists of methods used to make decisions or draw conclusions about a population using information contained in a sample

  • Inference is divided into two major areas:

    • Parameter estimation (both point and interval)

    • Hypothesis testing


Overview of Statistical Hypotheses

  • Many engineering problems require a decision to be made regarding some statement about a parameter

    • The statement is called a hypothesis

    • The decision-making process about the hypothesis is call hypothesis testing

  • Statistical hypothesis testing is usually the data analysis stage of a comparative experiment

  • A procedure leading to a decision about a particular hypothesis is called a test of hypothesis

  • Testing the hypothesis involves taking a random sample, computing a test statistic from the sample data and then using the to make a decision


Statistical Hypothesis

  • A statistical hypothesis is a statement about the parameters of one or more populations

  • A statistical hypothesis has two parts a null hypothesis (denoted \(H_0\)) and an alternative hypothesis (denoted \(H_1\))

    • The null hypothesis contains an equality statement about the value of parameter. For example \(H_0:\mu=12\mbox{ ounces}\).

    • There are three possible alternative hypotheses: \(H_1:\mu\neq 12\), \(H_1:\mu<12\), or \(H_1:\mu>12\)

    • The goal of the research will determine the appropriate alternative hypothesis



Errors in hypothesis testing

  • Whether a correct decision is made depends upon the true nature of \(H_0\) and the decision arrived at.

  • A type I error occurs when the null hypothesis is true and the outcome of the test is to reject \(H_0\). The probability of a type I error is denoted as \(\alpha\)

  • A type II error occurs when the null hypothesis is false and the outcome of the test is to fail to reject \(H_0\). The probability of a type II error is denoted as \(\beta\).

  • The power of a statistical test is the probability rejecting the null hypothesis \(H_0\) when the alternative hypothesis is true. \(\mbox{Power}=1-\beta\)


Error Example: Manufacturing


Error Example: Medical


General Procedure for Hypothesis Testing

The following sequence of steps is recommended

  1. From the problem context, identify the parameter of interest,

  2. State the null hypothesis, \(H_0\),

  3. Specify an appropriate alternative hypothesis, \(H_1\),

  4. Choose a significance level \(\alpha\)

  5. State an appropriate test statistic,

  6. State the rejection region for the (test) statistic,

  7. Compute any necessary sample quantities, substitute these into the equation for the test statistics, and compute that value,

  8. Decide whether or not \(H_0\) should be rejected and report in the problem context


Chapter 9, Case 1

Inference on the Mean of a population, variance known

  • Assumptions:

    1. \(X_1,X_2,\ldots,X_n\) is a random sample of size \(n\) from a population

    2. The population is normal, or if it is not normal, the conditions of the central limit theorem apply

  • The parameter of interest is \(\mu\)

  • The null hypothesis is \(H_0:\mu=\mu_0\)

  • The test statistic is

\[ Z_0=\frac{\overline{X}-\mu_0}{\sigma/\sqrt{n}} \]

and has a standard normal distribution


  • The alternative hypotheses and corresponding critical value(s) are shown in figure 9-11 on page 209


Summary for hypothesis test on the mean, variance known

  • See the material on the inside cover of your textbook


Problem 1


Problem 2


Connection between Hypothesis Tests and CI

  • There is a close connection between confidence intervals and hypothesis tests

  • Consider a \(100(1-\alpha)\%\) confidence interval on \(\mu\) and a hypothesis test of size \(\alpha\) shown below

\[ \begin{aligned} H_0:\mu=\mu_0\\ H_1:\mu\neq\mu_0\\\ \end{aligned} \]
  • The conclusion to reject \(H_0\) will be reached if \(\mu_0\) is not contained within the confidence interval

  • If \(\mu_0\) is within the confidence interval, we fail to reject \(H_0\)

  • The \(100(1-\alpha)\%\) confidence interval on \(\mu\) is the acceptance region


\(P\)-values

  • Is a widely used alternative to the traditional hypothesis test

  • Definition: The \(p\)-value is the smallest level of significance that would lead to reject of the null hypothesis \(H_0\) with the given data

  • Formulas are given below

\[ P= \begin{cases} 2[1-\Phi(|z_0|)]&\mbox{for a two-tailed test}\\ 1-\Phi(z_0)&\mbox{for a upper-tailed test}\\ \Phi(z_0)&\mbox{for a lower-tailed test} \end{cases} \]
  • Usage: if \(p\)-value<\(\alpha\) then the conclusion is reject H0, otherwise fail to reject H0

Practice Problem Chapter 9, Case 1 2-sided


Practice Problem Chapter 9, Case 1 Lower


Practice Problem Chapter 9, Case 1 Upper


Type II error and sample size for a two-tailed test

  • Probability of type II error for the two-tailed test
\[ \beta=\Phi\left(z_{\alpha/2}-\frac{\delta\sqrt{n}}{\sigma}\right)-\Phi\left(-z_{\alpha/2}-\frac{\delta\sqrt{n}}{\sigma}\right) \]

where \(\mu=\mu_0+\delta\)

  • The sample to detect a difference between the true and hypothesized mean of \(\delta\) with power at least \(1-\beta\) is
\[ n\approx\frac{(z_{\alpha/2}+z_\beta)^2\sigma^2}{\delta^2} \]

where \(\delta=\mu-\mu_0\)


Type II error and sample size for the one-tailed tests

  • For an upper-tailed test
\[ \beta=\Phi\left(z_\alpha-\frac{\delta\sqrt{n}}{\sigma}\right) \]
  • For a lower-tailed test
\[ \beta=1-\Phi\left(-z_\alpha-\frac{\delta\sqrt{n}}{\sigma}\right) \]
  • The sample size required to detect a difference between the true mean and hypothesized mean of \(\delta\) with power at least \(1-\beta\) is
\[ n=\frac{(z_\alpha+z_\beta)^2\sigma^2}{\delta^2} \]

If \(n\) is not an integer, round up to the nearest integer


R: Chapter 9 Case 1 Hypothesis Testing


Power using OC-Curve

Find the power when the true mean value is 3.325


R: Chapter 9 Case 1 Power


Type II Error Rate and Sample Size

  • You will not be required to calculate or use OC-curves
  • You must understand the concept and be able to correctly identity type I and type II error

Chapter 9, Case 2

Hypothesis Test on the Mean, Variance Unknown

  • Much more common case than variance known

  • Substitute \(S\) for \(\sigma\)

  • The test statistics is now a \(t\) random variable

\[ T=\frac{\overline{X}-\mu_0}{S/\sqrt{n}} \]

Summary of Case 2


Problem 9.3.6




Classical Approach


Hypothesis Test Using R


Normal Probability Plot


\(P\)-values

  • More difficult to calculate since the \(t\)-tables only contain a few quantiles

  • Can use tables to generate bounds on the \(p\)-value

  • Software will provide \(p\)-values


P-values from R


Power Calculations

  • Are much more complicated

  • The true distribution is now a non-central \(t\)

  • Use tables to solve (Chart VII in appendix) or software


Power Calculation using R


Sample Size using R


Chapter 9, Case 2 2-sided Practice Problems


Chapter 9, Case 2 Lower Practice Problems


Chapter 9, Case 2 Upper Practice Problems


Case 3. Hypothesis Test on Variance of Normal Population

  • The test statistics is a \(\chi^2\) random variable
\[ \chi^2_0=\frac{(n-1)S^2}{\sigma^2_0} \]

- The table below summarizes the three possible hypothesis tests. The rejection regions are clearly shown in Figure 9-17 on page 222


Figure 9-17


Test Summary

  • See summary in your textbook


Problem 7.108

Problem taken from Ostle, Turner, Hicks and McElrath (1996). Engineering Statistics: The Industrial Experience. Duxbury Press.


Statistics for Problem 7.108


Classical Approach


Problem 7.108 Plots


Problem 7.108 Plots


Problem 7.108 Shapiro-Wilks Test


p-values

  • Very similar to the case for the mean of a normal population with variance unknown

  • Difficult to calculate since the \(\chi^2\)-tables only contain a few quantiles

  • Can use tables to generate bounds on the \(p\)-value

  • Software will provide \(p\)-values


Test on Variance using R (EnvStats)


Power Calculations

  • Can be done with OC curves found in Table VIIi--n

  • Can be done in software such as R


Test on Standard Deviation

  • What about test on standard deviation?

Chapter 9, Case 3 2-sided Practice Problems


Practice Problem Chapter 9, Case 3 Lower


Practice Problem Chapter 9, Case 3 Upper


Case 4. Hypothesis Test on a Population Proportion

  • The test statistics for the hypothesis test is
\[ Z_0=\frac{x-np_0}{\sqrt{np_0(1-p_0)}} \]


Problem 9.5.2


Problem 9.5.2 Classic Approach


Power Calculations

  • For the two-sided alternative hypothesis
\[ \begin{aligned} \beta&=&\Phi\left(\frac{p_0-p+z_{\alpha/2}\sqrt{p_0(1-p_0)/n}}{\sqrt{p(1-p)/n}}\right)\\ &&-\Phi\left(\frac{p_0-p-z_{\alpha/2}\sqrt{p_0(1-p_0)/n}}{\sqrt{p(1-p)/n}}\right) \end{aligned} \]
  • If the alternative is \(H_1:p<p_0\)
\[ \beta=1- \Phi\left(\frac{p_0-p-z_{\alpha}\sqrt{p_0(1-p_0)/n}}{\sqrt{p(1-p)/n}}\right) \]
  • and finally if the alternative hypothesis is \(H_1:p>p_0\)
\[ \beta=\Phi\left(\frac{p_0-p+z_{\alpha}\sqrt{p_0(1-p_0)/n}}{\sqrt{p(1-p)/n}}\right) \]

Sample Size

  • Sample size requirements to satisfy type II(\(\beta\)) error constraints for a two-tailed hypothesis test is given by
\[ n=\left[\frac{z_{\alpha/2}\sqrt{p_0(1-p_0)}+z_\beta\sqrt{p(1-p)}}{p-p_0}\right]^2. \]
  • For a sample size for a one-sided test substitute \(z_\alpha\) for \(z_{\alpha/2}\).

  • Problem 9.95


Testing for Goodness of Fit

  • Material is presented in section 9-7 of your textbook

  • Procedure determines if the sample data is from a specified underlying distribution

  • Procedure uses a \(\chi^2\) distribution

  • Example 9-12 presents a \(\chi^2\) goodness of fit test for a Poisson example

  • Example 9-13 presents a \(\chi^2\) goodness of fit test for a normal example


Procedure

  1. Collect a random sample of size \(n\) from a population with an unknown distribution,

  2. Arrange the \(n\) observations in a frequency distribution containing \(k\) classes

  3. Calculate the observed frequency in each class \(O_i\),

  4. From the hypothesized distribution, calculate the expected frequency in class \(i\), denoted \(E_i\) (if \(E_i\) is small combine classes)

  5. Calculate the test statistic

\[ \chi^2_0=\frac{\sum_{i=1}^k\left(O_i-E_i\right)^2}{E_i} \]
  1. Reject the null hypothesis if the calculated value of the test statistic \(\chi^2_0>\chi^2_{\alpha,k-p-1}\) where \(p\) is the number of parameters in the hypothesized distribution

Example 9.12, part 1


Example 9.12, part 2


Chapter 9 Summary

  • You should be prepared to work any practice problems assigned: Cases 1-3 with three different alternatives
  • All other information is conceptual knowledge that can be questioned with multiple choice
    • Name 3 ways to test if data is from a normal distribution