250 likes | 505 Views
Hypothesis Testing. Ch 10, Principle of Biostatistics Pagano & Gauvreau Prepared by Yu-Fen Li. Statistical Inference. Estimation of parameters point estimation interval estimation Tests of statistical hypotheses construct a confidence interval for the parameter
E N D
Hypothesis Testing Ch 10, Principle of Biostatistics Pagano & Gauvreau Prepared by Yu-Fen Li
Statistical Inference • Estimation of parameters • point estimation • interval estimation • Tests of statistical hypotheses • construct a confidence interval for the parameter • conduct a statistical hypothesis test • critical value • p-value
Steps of hypothesis testing • Predetermine a significance level (α) • Usually set at 0.05 • State the null (H0) & alternative (Ha) hypotheses • Collect sample data • Calculate the test statistic • Construct the CI / find the critical value or p-value • Make the conclusion • reject H0 / do not reject H0
Ho and Ha • Ho and Ha are mutually exclusive and exhaustive (i.e. one of the two statements must be true) • Two-sided tests • One-sided tests • v.s. • A two-sided test is always the more conservative choice • the p-value of a two-sided test is twice as large as that of a one-sided test
P-value • Given that Ho is true, the probability of obtaining a mean as extreme as or more extreme than the observed sample mean (or test statistic) is called the p-value of the test • If p is less than or equal to α, we reject H0 • If p is greater than α, we do not reject H0 Ho
Reject or not reject • a mathematical equivalence between CIs and tests of hypothesis • Any value of z that is between -1.96 and 1.96 would result in a p-value greater than 0.05. • H0 would be rejected for any value of z that is either less than -1.96 or greater than 1.96. • At the α = 0.05 level, the numbers -1.96 and 1.96 are called the critical values of the test statistic.
Common Misunderstandings of Statistical Hypothesis Testing • The p value is the probability that the null hypothesis is incorrect. • WRONG! The p value is the probability of the current data or data that is more extreme assuming H0 is true • Small p values indicate large effects. • WRONG! p values tell you next to nothing about the size of an effect
Z-Tests and t-Tests • Assume that the continuous r.v. X has mean μ0 and the known standard deviation σ • When n is large enough, the test statistic (TS) • When the standard deviation σ is not known, we substitute the sample value s for σ. • If X is normally distributed, the test statistic (TS)
Example 1: Z-test • A random sample of 12 hypertensive smokers has mean serum cholesterol level = 217 mg/100 ml. Is it likely that this sample comes from a population with mean = 211 mg/100 ml? the area to the right of z = 0.45 is 0.326 Therefore, the p-value of the test is 0.652. If the significance level is set to be α = 0.05, we do not reject Ho for p > 0.05
Example 2: t-test • The underlying distribution of plasma aluminum levels for this population is approximately normal with unknown mean μ and standard deviation σ. Consider a random sample of 10 children selected from a population of infants receiving antacids containing aluminum with mean plasma aluminum levels 37.20 μg/l and standard deviation 7.13 μg/l. • Is it likely that the data in our sample could have come from a population of infants not receiving antacids with mean μ0 = 4.13 μg/l? the total area to the right of 14.67 and to the left of -14.67 is less than 2(0.0005)=0.001. Therefore, p < 0.05, and we reject the null hypothesis
Example: one-sided test • Consider the distribution of hemoglobin levels for the population of children under the age of 6 who have been exposed to high levels of lead. • we are concerned only with deviations from the mean that are below μ0=12.29 g/100 ml, the mean hemoglobin level of the general population of children: vs
Example: one-sided test • A random sample of 74 children who have been exposed to high levels of lead has a mean hemoglobin level of 10.6 g/100 ml with σ = 0.85 g/100 ml. the area to the left of z is less than 0.001. Since this p-value<α = 0.05, we reject Ho. Note 12.29 lies above 10.8 which is the upper one-sided 95% confidence bound for μ in pervious chapter
A slide in Ch 9 Example: an one-sided confidence interval • A sample of 74 kids who have been exposed to high levels of lead from a population with an unknown mean μ and standard deviation σ = 0.85 g/100 ml • These 74 children have a mean hemoglobin level 10.6 g/100 ml. Based on this sample, a one-sided 95% CI for μ - the upper bound only – is • We are 95% confident that the true mean hemoglobin level for this population of children is at most 10.8 g/100 ml
Types of Error • Two kinds of errors can be made when we conduct a test of hypothesis Ho is true Ha is true
Example • The mean serum cholesteric levels for all 20- to 74-yr-old males in US is μ = 211 mg/100 ml and the standard deviation is σ = 46 mg/100 ml. • If we do not know the true population mean but we know the mean serum cholesterol levels for the subpopulation of 20- to 24-yr-old males is 180 mg/100 ml • What is the probability of the type II error associated with such a test, assuming that we select a sample of size 25 and at the α = 0.05 level of significance?
Example: Step 1 Find the cutoff under the Type I error rate • find the mean serum cholesterol level for Ho to be rejected for α = 0.05 (pink area) Ho
Example: Step 2 Find the type II error rate • What is the chance of obtaining a sample mean that is less than 195.1 mg/100 ml given that the true population mean is 211 mg/100 ml? Ha
Comment • The type II error is calculated for a single such value, μ1. • If we had chosen a different alternative population mean, we would have computed a different value for β. • The closer μ1 is to μ0, the more difficult it is to reject the null hypothesis. • β (yellow area) is bigger when μ1 is closer to μ0
Statistical Power • The power of the test of hypothesis is the probability of rejecting the null hypothesis when H0 is false, which is 1 - β. • In other words, it is the probability of avoiding a type II error
Sample Size Estimation • If we conduct a one-sided test of the null hypothesis • If we conduct a two-sided test, the sample size necessary to achieve a power of 1 - β at the α level is
Under H0, • Under Ha, c
Sample size calculation • A one-sided test will be conducted at the = 0.05. • Assume =0.85, 0=11.79, and 1 =12.29 • We want a power of 0.80 (1-) • Therefore, • A sample of size 18 would be required
What are the factors influencing the statistical power of a test? • • n • • • |0-1|