Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
N318b Winter 2002 Nursing Statistics Lecture 7 Specific statistical tests Chi-square (2) Today’s Class 5 basic statistical tests covered in course Parametric and non-parametric tests Degrees of freedom << 10 min break >> Example of chi-square test Applying knowledge to assigned readings Turk et al. (1995) Followed by small groups 12-2 PM Focus on interpreting chi-square results School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 2 “In Group” Session Missing Table 1 Focuses on an assigned reading. Q1 example of the chi square test Q2 example of the chi square test Q3 criteria for non-parametric test Key points from the Turk et al paper will be covered in the 2nd part of the lecture School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 3 New Lecture Material Specific statistical tests: Parametric and nonparametric tests School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 4 Specific Statistical Tests Course will cover five major “tests”: 1. Chi-square (2) 2. T-tests 3. Analysis of variance (ANOVA) 4. Correlation 5. Regression School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 5 Statistical Tests – cont’d All these tests do basically the same 3 things: 1. Compare 2 or more study groups to each other (or one group to a reference group) 2. Generate a “test statistic” whose value increases as difference between groups increases (i.e. larger values more significant) 3. “test statistic” follows known distributions such that the probability of its value occurring can be determined (i.e. its “p-value”) Example: Z-scores School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 6 Statistical Tests – cont’d How do you known when to use which test? Helps to ask some basic questions: 1. What kind of data are used? - ratio/interval or categorical (ordinal/nominal) - dependent (e.g. follow-up) or independent 2. What kind of relationship is of interest? - prediction, association or difference? 3. How many groups (samples) involved? - one, two, or more than two School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 7 Non-Parametric Tests Key point is determining type of data For categorical (i.e. either nominal or ordinal data) the normal distribution is generally not applicable and population descriptors (parameters) cannot be estimated so non-parametric tests used Main non-parametric test is the chi-square test that compares expected (E) numbers with actual or observed (O) numbers School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 8 Parametric Tests For continuous (i.e. either interval or ratio data) the normal distribution applies and population descriptors (parameters, like means) can be estimated thus parametric tests are used instead Main tests for this course include the t-test, paired t-test and analysis of variance (ANOVA), all of which test means School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 9 Parametric vs. nonparametric tests Data used Nonparametric (numbers, %’s) Parametric (means, variances) Examples Nominal, Chiordinal square (categorical) Comments Easy to use but limited to simple situations Interval, T-tests, More flexible ratio ANOVA, and powerful (continuous) regression (also more convincing) School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 10 Degrees of Freedom Recall the formula for SD was “adjusted” for imprecision of small samples SD = (x)2 n -1 The (n-1) term is referred to as “degrees of freedom” since it indicates how many ways that the data can vary in a sample School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 11 Degrees of Freedom – cont’d Value of “test statistic” derived from many statistical tests is dependent on this idea of “degrees of freedom” thus some sense of what it means is useful (e.g. see textbook page 84-85) df = number of ways that data can vary (or be categorized) Example – for chi square test: df = (number of categories –1) School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 12 Degrees of Freedom – cont’d Example – for chi square test: df = (number of categories –1) Why? If total number of subjects is known, and they are categorized into 4 groups, then if three tallies are known the fourth is “fixed” – i.e. it can be derived so it is not “free” to vary df = (4 –1) = 3 School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 13 Chi square (2) test How do you known when to use 2 test? Referring back to the 3 “basic questions”: 1. What kind of data are used? - categorical ( typically nominal) - frequencies (i.e. counts or percentages) - data can be put in a “contingency table” 2. What kind of relationship is of interest? - association or difference 3. How many groups (samples) involved? - usually two or more (“smallish” number) School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 14 Chi square test - example One of the most common statistical tests ! Example: We suspect that students at UWO love statistics a lot so we ask 100 nursing students if they really like Nur 318b? 63 say YES, 37 say NO Is this more than we might have expected – i.e. are UWO nurses crazy about statistics? School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 15 Chi square test - example If we did not think students would be more or less likely to enjoy the course, we would EXPECT 50 to say no and 50 to say YES Study hypotheses H0: no difference in OBS versus EXP counts Ha: OBS count is NOT equal to EXP 2 compares observed vs expected numbers School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 16 Chi square test - example YES NO at UWO (observed) 67 In general (expected) 50 = 33 2 50 (67-50)2 + (33-50)2 50 = (O-E)2 E = 11.56 50 School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 17 Chi square test - example As with Z-scores, we now look this number (11.56) up in a table of critical values, in this case for the chi square distribution (table value is the probability that observed and expected numbers are the same) 2 (1 df) = 11.56, p < 0.001 Thus we can conclude that UWO nursing students must love stats !!! School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 18 10 minute break ! School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 19 Chi square test - assumptions 1. Data are counts, frequencies, percentages 2. Smallest table cell counts ideally >5 3. Data in rows and columns are independent (i.e. subjects can be in one table cell only) 4. Categories or levels set BEFORE testing School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 20 Chi square test - assumptions Why is the chi square a nonparametric statistical test? 1) it does not assume data are normally distributed (in fact NO assumptions are needed about underlying distribution) 2) categorical/nominal data are used 3) not estimating a population characteristic (i.e. a parameter, like the mean) School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 21 Part 2: Application to the Assigned Readings School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 22 Turk et al. (1995) Quick summary of the paper: – a cross-sectional study examining the cognitive-behavioral mediation model of depression in chronic pain patients – 100 chronic pain subjects divided into two groups: 73 randomly chosen younger (<70); and 27 older (70 yrs) patients – found a strong link between pain and depression for older subjects but not for younger ones (i.e. an age effect) School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 23 Some design issues? Do you have any concerns with design of the study – e.g. using a cross-sectional design to examine chronic pain and depression? Which came first (“chicken-and-egg”)? Can pain be more of “social” problem with older people thus “confounding” assessment of depression? Was assessment of depression “blinded”? School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 24 Chi square test – example 2: the contingency table Observed counts from Table 1 Gender young old Total Male 45.21 (33) 37.04 (10) 43 54.79 (40) 100% (73) 62.96 (17) 100% (27) Female Total 57 100 School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 25 Chi square test – example 2: the contingency table How did we get counts from %’s? Just multiply % by total number in group e.g. 45.21% male in younger group is equal to 0.4521 x 73 = 33 males How do we get expected counts? Expected counts assume no association between groups thus they are calculated according to size of cells in groups School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 26 2 Contingency Table Expected counts Eij = Ri x Cj N For cell 1,1: E11 = R1 x C1 100 For cell 1,2 = 11.6 43 x 73 = = 31.4 100 For cell 2,2 = 15.4 For cell 2,1 = 41.6 School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 27 2 Contingency Table Expected counts C1 R1 R2 C2 Gender young old Total Male 33 (31.4) 10 (11.6) 43 40 (41.6) 73 17 (15.4) 27 57 100 Female Total School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 28 2 Contingency Table Test statistic 2 = (O-E)2 E 2 + (10-11.6)2 + (40-41.6)2 + (17-15.4)2 (33-31.4) = 31.4 11.6 41.6 15.4 2 (1 df) = 0.54, p > 0.20 Can’t reject null hypothesis, thus no association ! School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 29 Next Week - Lecture 8: T-test For next week’s class please review: 1. Page 16 in syllabus 2. Textbook Chapter 4, pages 97-107 3. Syllabus paper: Turk et al. (1995) School of Nursing Institute for Work & Health Nur 318b 2002 Lecture 6: page 30