Inferences Based on a Single Sample: Tests of Hypothesis

Inferences Based on a Single Sample: Tests of Hypothesis

  • Inferential statistics involves using sample statistics to make decisions or predictions about population parameters.

Statistical vs. Non-statistical Examples

  • Statistical Example:
    • A soft-drink company claims its cans contain 12 ounces of soda on average.
    • A government agency tests this claim by sampling 100 cans.
  • Non-statistical Example:
    • A person indicted for a crime is tried in court.
    • Based on evidence, the judge decides if the person is guilty or not guilty.
    • The person is presumed not guilty.

Hypotheses

  • Null Hypothesis (H0): The hypothesis to be tested (hypothesis of no difference).
    • In the court example: The person is not guilty.
    • In the soda example: μ=12\mu = 12
  • Alternative Hypothesis (H1): A statement of what we believe is true if the sample data cause us to reject the null hypothesis.
    • In the court example: The person is guilty.
    • In the soda example: \mu < 12

Rejection and Non-rejection Regions

  • Rejection Region: Enough evidence to reject the null hypothesis.
  • Non-rejection Region: Not enough evidence to reject the null hypothesis.
  • Critical Point: The boundary between the rejection and non-rejection regions.
  • Level of Evidence: Used to determine whether to reject or not reject the null hypothesis.

Types of Errors

  • Type I Error: Rejecting a true null hypothesis.
    • α = P(H0 is rejected | H0 is true)
    • α is the significance level of the test, set by the researcher in advance.
  • Type II Error: Failing to reject a false null hypothesis.
    • β = P(H0 is not rejected | H0 is false)
    • 1 - β is the power of the test.

Type I & II Error Relationship

  • Type I and Type II errors cannot occur simultaneously.
    • Type I error can only occur if H0 is true.
    • Type II error can only occur if H0 is false.
  • If Type I error probability (α) increases, then Type II error probability (β) decreases.

Errors in Hypothesis Testing

DecisionH0 is TrueH0 is False
Do not reject H0Correct Decision (1 - α)Type II error (β)
Reject H0Type I error (α)Correct Decision (1 - β)

One-tailed and Two-tailed Tests

  • Two-tailed Test: Rejection region in both tails of the distribution.
  • One-tailed Test: Rejection region in one tail of the distribution (left or right).

Summary Table for Hypothesis Tests

FeatureTwo-tailed TestLeft-tailed TestRight-tailed Test
Sign in the null hypothesis== or ≥= or ≤
Sign in the alternative hypothesis<>
Rejection regionIn both tailsIn the left tailIn the right tail

Steps to Perform a Test of Hypothesis (Critical Value Approach)

  1. State the null and alternative hypotheses.
  2. Select the appropriate distribution.
  3. Determine the rejection and non-rejection regions.
  4. Calculate the test statistic:
    • Test statistic=Point estimateParameter value at H0Standard deviation of the point estimator(Estimated or true)Test\ statistic = \frac{Point\ estimate – Parameter\ value\ at\ H_0}{Standard\ deviation\ of\ the\ point\ estimator (Estimated\ or\ true)}
  5. Make a decision (reject or fail to reject the null hypothesis).

Example 1: Hypothesis Test About a Population Mean (σ known)

  • A soft-drink company claims its cans contain 12 ounces of soda on average.
  • A government agency samples 100 cans and finds a mean of 11.8 ounces.
  • Assume a normal population with a known standard deviation of 1 ounce.
  • Significance level α = 10%.
  • Test whether the mean amount of soda per can is less than 12 ounces.
Critical Value Approach
  • H0: μ=12\mu = 12
  • H1: \mu < 12
  • Test statistic: z=xˉμσn=11.8121100=2z = \frac{\bar{x} - \mu}{\frac{\sigma}{\sqrt{n}}} = \frac{11.8 - 12}{\frac{1}{\sqrt{100}}} = -2
  • Since z = -2, we reject H0 and accept H1.
Probability Value Approach (P-value Approach)
  • P-value: The smallest significance level at which the null hypothesis is rejected.
  • Reject H0 if p-value < α; do not reject H0 if p-value ≥ α.
  • In this case, p-value = 0.0228.

Conditions for Using the t-distribution

  • Used when the population standard deviation (σ) is unknown, and we use the sample standard deviation (S) as an estimator.
    1. The population is approximately normally distributed.
    2. The population standard deviation is unknown.

Example 2: Hypothesis Test About a Population Mean (σ unknown)

  • Psychologists claim that the mean age at which children start walking is 12.5 months.
  • Carol samples 16 children and finds a mean of 12.6 months.
  • Sample standard deviation = 0.4 months.
  • Significance level α = 10%.
  • Test if the mean age at which all children start walking is different from 12.5 months.
Hypothesis Test
  • H0: μ=12.5\mu = 12.5
  • H1: μ12.5\mu ≠ 12.5
  • Test statistic: t=xˉμsn=12.612.50.416=1t = \frac{\bar{x} - \mu}{\frac{s}{\sqrt{n}}} = \frac{12.6 - 12.5}{\frac{0.4}{\sqrt{16}}} = 1
  • Degrees of freedom: df = n - 1 = 15.
  • Since the p-value > α, we fail to reject H0.

Conditions for Using the Binomial Distribution

  • Used to test hypotheses about a population proportion.
  • The n trials must satisfy the assumptions underlying the binomial distribution.
  • A sample is considered large if:
    1. np5np ≥ 5
    2. nq5nq ≥ 5
    • Where p + q = 1.

Example 3: Hypothesis Test About a Population Proportion (Large Sample)

  • A machine should not produce more than 5% defective chips.
  • A sample of 400 chips contains 28 defective chips.
  • Significance level α = 10%.
  • Test whether the machine needs an adjustment.
Hypothesis Test
  • H0: p = 0.05
  • H1: p > 0.05
  • Test statistic: z=p^p<em>0p</em>0(1p0)nz = \frac{\hat{p} - p<em>0}{\sqrt{\frac{p</em>0(1-p_0)}{n}}}
  • The value of the test statistics ≈ 1.84
  • p-value = 0.0329
  • Since p-value < α, we reject H0 and accept H1.

Using Excel to Test Hypotheses

  • Z-Test: Z.TEST returns the p-value for a right-tail test or P(Z ≥ z).
  • T-Test:
    • T.DIST returns the p-value for a left-tail test or P(T ≤ t).
    • T.DIST.RT returns the p-value for a right-tail test or P(T ≥ t).
    • T.DIST.2T returns the p-value for a two-tail test, using the absolute value of the test statistics.

Relation Between Tests of Hypothesis and Confidence Intervals

  • Connection between two-tailed tests and confidence intervals.
  • Consider the (1-α)100% confidence interval for µ.
  • H0: μ=μ0\mu = \mu_0
  • H1: μμ0\mu ≠ \mu_0
  • Rejection region and non-rejection region.
Example
  • Using a 95% CI based on the t-distribution, decide whether to reject H0:
    • a) H0: μ=320\mu = 320, H1: μ320\mu ≠ 320, α = 0.05
    • b) H0: μ=310\mu = 310, H1: μ310\mu ≠ 310, α = 0.05
    • c) H0: μ=310\mu = 310, H1: μ310\mu ≠ 310, α = 0.02