E N D
Statistics for clinicians Biostatistics course by Kevin E. Kip, Ph.D., FAHAProfessor and Executive Director, Research CenterUniversity of South Florida, College of NursingProfessor, College of Public HealthDepartment of Epidemiology and BiostatisticsAssociate Member, Byrd Alzheimer’s InstituteMorsani College of MedicineTampa, FL, USA
SECTION 4.1 Module Overview and Introduction Hypothesis testing for 2 or more independent groups and non-parametric methods.
Module 4 Learning Outcomes: • Calculate and interpret 2 sample hypotheses: • 2 sample – continuous outcome • >2 samples – continuous outcome • 2 sample dichotomous outcome • >2 samples dichotomous outcome • Specify 2-sample hypotheses and conduct formal testing using SPSS • Differentiate between parametric and non-parametric tests • Identify properties of non-parametric tests
Module 4 Learning Outcomes: • Calculate and interpret non-parametric tests: • 2 independent samples – Wilcoxon Rank Sum Test • Matched samples – Wilcoxon Signed Rank Test • >2 independent samples – Kruskal Wallis Test • Conduct and interpret non-parametric analyses using SPSS.
Assigned Reading: Textbook: Essentials of Biostatistics in Public Health Chapter 7 Sections 7.5, 7.7 to 7.9 Pages 138-141 and 144-162 Chapter 10
SECTION 4.2 Framework of hypothesis testing
General Steps for Hypothesis Testing: • Set up the hypothesis and determine the level of statistical significance (including 1 versus 2-sided hypothesis). • Select the appropriate test statistic • Set up the decision rule • Compute the test statistic • Conclusion (interpretation)
Hypothesis Testing Calculations: • Two Sample – Independent Groups • Continuous outcome (student t test) • Dichotomous outcome (risk difference or risk ratio—chi-square test) • More than 2 Samples – Independent Groups • Continuous outcome (analysis of variance-ANOVA) • Categorical Outcome (chi-square test)
Framework of Hypothesis Testing • Goal is to compare sample parameter estimates (e.g. mean, proportion, etc.) between 2 or more independent groups. • The groups can be defined from a clinical trial, such as treatment versus placebo, or an observational study, such as men versus women, or exposed versus not exposed. • With 2 groups, one group serves as the “comparison” or “control” group representing the null value. • Groups do not need to be of the same size. • With more than 2 groups, can compare whether any groups differ (e.g. means) or whether groups differ in an ordered manner.
SECTION 4.3 Two-sample: independent groups – continuous outcome
1. Two-Sample: Independent Groups-Continuous Outcome • Parameter: Difference in population means: μ1 – μ2 • H0:μ1 – μ2 = 0; μ1 = μ2 • H1: μ1 > μ2; μ1 < μ2; μ1 = μ2; • Test statistics: Critical value of z in Table 1C n1> 30 and n2> 30 Critical value of t in table 2 d.f. = n1 + n2 - 2 n1 < 30 or n2 < 30
1. Two-Sample: Independent Groups-Continuous Outcome Example: From the Framingham Heart Study (offspring), compare mean systolic blood pressure between men and women. nXs Men 1623 128.2 17.5 Women 1911 126.5 20.1 1) Set up the hypothesis and determine the level of statistical significance (including 1 versus 2-sided hypothesis). H0: μ1 = μ2 H1: μ1 = μ2 (two-sided hypothesis) α = 0.05
1. Two-Sample: Independent Groups-Continuous Outcome • Example: From the Framingham Heart Study (offspring), compare mean systolic blood pressure between men and women. • nXs • Men 1623 128.2 17.5 • Women 1911 126.5 20.1 • Select the appropriate test statistic: • n1> 30 and n2> 30, so use z • Set up the decision rule: • Reject H0 if z< 1.96 or z> 1.96
1. Two-Sample: Independent Groups-Continuous Outcome Example: From the Framingham Heart Study (offspring), compare mean systolic blood pressure between men and women. nXs Men 1623 128.2 17.5 Women 1911 126.5 20.1 4) Compute the test statistic: = sqrt(359.12) = 19.0 • Conclusion: Reject H0 because 2.66 > 1.96
1. Two-Sample: Independent Groups-Continuous Outcome (Practice) • Example: From the Heart SCORE Study, compare mean total cholesterol levels between men and women. (α = 0.05) • nXs • Men 165 198.88 38.416 • Women 337 222.23 42.023 • 1) Set up the hypothesis and determine the level of statistical significance (including 1 versus 2-sided hypothesis). • H0: _________________ • H1: _________________ • Select the appropriate test statistic: • n1> 30 and n2> 30, so use z __________________ • Set up the decision rule: • _________________________________________
1. Two-Sample: Independent Groups-Continuous Outcome (Practice) • Example: From the Heart SCORE Study, compare mean total cholesterol levels between men and women. (α = 0.05) • nXs • Men 165 198.88 38.416 • Women 337 222.23 42.023 • 1) Set up the hypothesis and determine the level of statistical significance (including 1 versus 2-sided hypothesis). • H0: μ1 = μ2 • H1: μ1 = μ2 (two-sided hypothesis) • Select the appropriate test statistic: • n1> 30 and n2> 30, so use z • Set up the decision rule: • Reject H0 if z< 1.96 or z> 1.96
1. Two-Sample: Independent Groups-Continuous Outcome (Practice) • Example: From the Heart SCORE Study, compare mean total cholesterol levels between men and women. (α = 0.05) • nXs • Men 165 198.88 38.416 • Women 337 222.23 42.023 • Compute the test statistic • Conclusion: _________________________________
1. Two-Sample: Independent Groups-Continuous Outcome (Practice) • Example: From the Heart SCORE Study, compare mean total cholesterol levels between men and women. (α = 0.05) • nXs • Men 165 198.88 38.416 • Women 337 222.23 42.023 • Compute the test statistic (165–1)(38.416)2 + (337–1)(42.023)2 Sp = = 40.875 165 + 337 - 2 198.88 – 222.23 -23.35 z = ----------------------- = ------- = -6.01 40.875 1/165 + 1/337 3.884 • Conclusion: Reject H0: abs(-6.01) > 1.96
1. Two-Sample: Independent Groups-Continuous Outcome (Practice) Example: From the Heart SCORE Study, compare mean total cholesterol levels between men and women. (α = 0.05) SPSS Analyze Compare Means Independent Samples T-Test Test Variable: Total cholesterol Group Variable: Gender (defined as 1,2) Options: 95% C.I.
SECTION 4.4 Two-sample: independent groups – dichotomous outcome
2. Two-Sample: Independent Groups-Dichotomous Outcome • Parameter: Risk Difference (RD)(p1 – p2) or Risk Ratio (RR)(p1 / p2) • H0:RD:p1 = p2; or p1 – p2 = 0; RR:p1 / p2 = 1.0 • H1: RD:p1 = p2; or p1 – p2 = 0; RR:p1 / p2 = 1.0 • Test statistics: Critical value of z in Table 1C min[n1p1, n1(1 – p1)] > 5 min[n2p2, n2(1 – p2)] > 5 Note:p = proportion of successes (outcomes)
2. Two-Sample: Independent Groups-Dichotomous Outcome Example: From the Framingham Heart Study (offspring), compare the prevalence of CVD between smokers and non-smokers. No CVD CVD Total Smoker 663 81 744 p1 = 81/744 = 0.1089 Non-smoker 2757 298 3055 p2 = 298/3055 = 0.0975 (RD)(p1 – p2 = 0.0114); Risk Ratio (RR)(p1 / p2 = 1.12) 1) Set up the hypothesis and determine the level of statistical significance (including 1 versus 2-sided hypothesis). H0: p1 = p2 H1: p1 = p2 (two-sided hypothesis) α = 0.05
2. Two-Sample: Independent Groups-Dichotomous Outcome Example: From the Framingham Heart Study (offspring), compare the prevalence of CVD between smokers and non-smokers. No CVD CVD Total Smoker 663 81 744 p1 = 81/744 = 0.1089 Non-smoker 2757 298 3055 p2 = 298/3055 = 0.0975 • Select the appropriate test statistic: min[n1p1, n1(1 – p1)] > 5 • min[n2p2, n2(1 – p2)] > 5 --- use z • Set up the decision rule: • Reject H0 if z< 1.96 or z> 1.96
2. Two-Sample: Independent Groups-Dichotomous Outcome Example: From the Framingham Heart Study (offspring), compare the prevalence of CVD between smokers and non-smokers. No CVD CVD Total Smoker 663 81 744 p1 = 81/744 = 0.1089 Non-smoker 2757 298 3055 p2 = 298/3055 = 0.0975 4) Compute the test statistic: 81 + 298 379 p = ---------------- = -------- = 0.0988 744 + 3055 3799 0.1089 – 0.0975 z = -------------------------------------------- = 0.927 0.0988(1 – 0.0988)(1/744 + 1/3055) • Conclusion: Do not reject H0: -1.96 < 0.927 < 1.96
2. Two-Sample: Independent Groups-Dichotomous Outcome (Practice) Example: From the Heart SCORE Study, compare the prevalence of diabetes by level of weekly exercise. ExerciseNo diabetes Diabetes Total < 3 times/wk 177 18 195 p1 = _____________ > 3 times/wk 278 23 301 p2 = _____________ (RD) (p1 – p2 = _______); Risk Ratio (RR) (p1 / p2 = _______) 1) Set up the hypothesis and determine the level of statistical significance (including 1 versus 2-sided hypothesis). H0: _____________________________ H1: _____________________________ α = 0.05
2. Two-Sample: Independent Groups-Dichotomous Outcome (Practice) Example: From the Heart SCORE Study, compare the prevalence of diabetes by level of weekly exercise. ExerciseNo diabetes Diabetes Total < 3 times/wk 177 18 195 p1 = 18/195 = 0.0923 > 3 times/wk 278 23 301 p2 = 23/301 = 0.0764 (RD) (p1 – p2 = 0.0159); Risk Ratio (RR) (p1 / p2 = 1.21) 1) Set up the hypothesis and determine the level of statistical significance (including 1 versus 2-sided hypothesis). H0: p1 = p2 H1: p1 = p2 (two-sided hypothesis) α = 0.05
2. Two-Sample: Independent Groups-Dichotomous Outcome (Practice) Example: From the Heart SCORE Study, compare the prevalence of diabetes by level of weekly exercise. ExerciseNo diabetes Diabetes Total <3 times/wk 177 18 195 p1 = _______ >3 times/wk 278 23 301 p2 = _______ • Select the appropriate test statistic: min[n1p1, n1(1 – p1)] > 5 • min[n2p2, n2(1 – p2)] > 5 --- use z • Set up the decision rule: • Reject H0 if: ________________________
2. Two-Sample: Independent Groups-Dichotomous Outcome (Practice) Example: From the Heart SCORE Study, compare the prevalence of diabetes by level of weekly exercise. ExerciseNo diabetes Diabetes Total <3 times/wk 177 18 195 p1 = 18/195 = 0.0923 >3 times/wk 278 23 301 p2 = 23/301 = 0.0764 • Select the appropriate test statistic: min[n1p1, n1(1 – p1)] > 5 • min[n2p2, n2(1 – p2)] > 5 --- use z • Set up the decision rule: • Reject H0 if z< 1.96 or z> 1.96
2. Two-Sample: Independent Groups-Dichotomous Outcome (Practice) Example: From the Heart SCORE Study, compare the prevalence of diabetes by level of weekly exercise. ExerciseNo diabetes Diabetes Total <3 times/wk 177 18 195 p1 = _______ >3 times/wk 278 23 301 p2 = _______ 4) Compute the test statistic: p = ______________ = __________ z = __________________________________ • Conclusion: ________________________________
2. Two-Sample: Independent Groups-Dichotomous Outcome (Practice) Example: From the Heart SCORE Study, compare the prevalence of diabetes by level of weekly exercise. ExerciseNo diabetes Diabetes Total <3 times/wk 177 18 195 p1 = 18/195 = 0.0923 >3 times/wk 278 23 301 p2 = 23/301 = 0.0764 4) Compute the test statistic: 18 + 23 41 p = ---------------- = -------- = 0.0827 195 + 301 496 0.0923 – 0.0764 z = ------------------------------------------- = 0.628 0.0827(1 – 0.0827)(1/195 + 1/301) • Conclusion: Do not reject H0: -1.96 < 0.628 < 1.96
2. Two-Sample: Independent Groups-Dichotomous Outcome (Practice) Example: From the Heart SCORE Study, compare the prevalence of diabetes by level of weekly exercise (α = 0.05) SPSS Analyze Descriptive Statistics Crosstabs Row Variable: Exercise >times/week Column Variable: History of diabetes Statistics – Chi-square Cells – Observed, Expected Note: Pearson chi-square test in SPSS includes Yates correction.
SECTION 4.5 More than two-samples: independent groups – continuous outcome
3. More Than Two Independent Groups-Continuous Outcome • Parameter: Difference in means for more than 2 groups (ANOVA) • H0:μ1 = μ2 = …μk • H1: Means are not all equal • Test statistic: F value Find critical value in Table 4 (df1 = k – 1; df2 = N – k) Where nj = sample size in the jth group (e.g. j = 1,2,3……) Xj = mean in the jth group X = overall mean k = number of independent groups (k > 2) N = total number of observations in analysis ANOVA Assumptions: Outcome follows a normal distribution (all groups) Variances approximately equal among groups
3. More Than Two Independent Groups-Continuous Outcome “Between-group” variability F = ---------------------------------------- “Residual or error” variability (“within-group” variability) (i.e. variability in the outcome); (null hypothesis is that all groups are random samples) F statistic assesses whether differences among the means (the numerator) are larger than expected by chance. F statistic has 2 degrees of freedom; df1 (numerator), df2 (denominator) df1 = k – 1; df2 = N – k Table 4 contains critical values for the F distribution
3. More Than Two Independent Groups-Continuous Outcome Analysis of Variance (ANOVA) Table *Textbook on page 150 has typographical error
3. More Than Two Independent Groups-Continuous Outcome Example: Weight Loss by Treatment (in Pounds) • Set up the hypothesis and determine level of statistical significance • H0: µ1 = µ2 = µ3 = µ4 H1: Means are not all equal; α = 0.05 • Select the appropriate test statistic
3. More Than Two Independent Groups-Continuous Outcome Example: Weight Loss by Treatment (in Pounds) • Set up the decision rule --- see critical value in Table 4 • df1 = k – 1 = 4 – 1 = 3 • df2 = N – k= 20 – 4 = 16 • Reject H0 if F> 3.24
3. More Than Two Independent Groups-Continuous Outcome Example: Weight Loss by Treatment (in Pounds) • Compute test statistic: SSB = SSE = • (ANOVA table) MSB = SSB / (k – 1) MSE = SSE / (N – k) • F = MSB / MSE • SSB = 5(6.6 – 3.6)2 + 5(3.0 – 3.6)2 + 5(3.4 – 3.6)2 + 5(1.2 – 3.6)2 • = 45.0 + 1.8 + 0.2 + 28.8 = 75.8 • SSE = 21.4 + 10.0 + 5.4 + 10.6 = 47.4 (see tables 7-24 to 7-28, page 151 of text) • MSB = 75.8 / (4 – 1) = 25.3 • MSE = 47.4 / (20 – 4) = 3.0 • F = 25.3 / 3.0 = 8.43 • 5) Conclusion: Reject H0; 8.43 > 3.24
3. More Than Two Independent Groups-Continuous Outcome Example: Weight Loss by Treatment (in Pounds) • ANOVA orthogonal contrasts of mean: • Sometimes, rather than just comparing a difference among all means, we wish to compare specific means or whether the means increase or decrease in a monotonic (linear) manner. This can be achieved with orthogonal contrasts of the means. • Sum of coefficients in each linear contrast must equal zero • In the example above: • µ1 versus (µ2, µ3, µ4) -3 1 1 1 • (µ1, µ2) versus (µ3, µ4) -1 -1 1 1 • (µ1, µ2, µ3) versus µ4-1 -1 -1 3 • linear trend -2 -1 1 2
3. More Than Two Independent Groups-Continuous Outcome (Practice) Example: Body Mass Index by Blood Pressure Classification • Set up the hypothesis and determine level of statistical significance • H0: __________________________________ • H1: ___________________________________ • α = 0.05 • Select the appropriate test statistic: __________________
3. More Than Two Independent Groups-Continuous Outcome (Practice) Example: Body Mass Index by Blood Pressure Classification • Set up the hypothesis and determine level of statistical significance • H0: µ1 = µ2 = µ3 = µ4 • H1: Means are not all equal; • H1: Means increase or decrease in a monotonic (linear) manner; • α = 0.05 • Select the appropriate test statistic
3. More Than Two Independent Groups-Continuous Outcome (Practice) Example: Body Mass Index by Blood Pressure Classification Total N = n1 + n2 + n3 + n4 = ___________________________ • Set up the decision rule --- see critical value in Table 4 • df1 = k – 1 = ___________ • df2 = N – k= ___________ • http://www.danielsoper.com/statcalc3/calc.aspx?id=4 • Reject H0 if: _______________________
3. More Than Two Independent Groups-Continuous Outcome (Practice) Example: Body Mass Index by Blood Pressure Classification Total N = n1 + n2 + n3 + n4 = 88 + 191 + 139 + 55 = 473 • Set up the decision rule --- see critical value in Table 4 • df1 = k – 1 = 4 – 1 = 3 • df2 = N – k= 473 – 4 = 469 • http://www.danielsoper.com/statcalc3/calc.aspx?id=4 • Reject H0 if F> 2.62
3. More Than Two Independent Groups-Continuous Outcome (Practice) Example: Body Mass Index by Blood Pressure Classification • Compute the test statistic F = ____________ N = ____ • Conclusion: ___________________________
3. More Than Two Independent Groups-Continuous Outcome (Practice) Example: Body Mass Index by Blood Pressure Classification • Compute the test statistic F = MSB / MSE N = 473 • Conclusion: Reject H0: 9.83 > 2.62 Linear trend: F=11.27
3. More Than Two Independent Groups-Continuous Outcome (Practice) Example: Body mass index and blood pressure classification in the Heart SCORE Study (α = 0.05) SPSS Analyze Compare Means One-Way ANOVA Dependent Variable: Body mass index Group Variable (Factor): Blood pressure class Contrasts -2 -1 1 2 Options: Descriptive Homogeneity of variance test Means plot