Download presentation
Presentation is loading. Please wait.
Published byGeorgia Maxwell Modified over 8 years ago
1
Doing Analyses on Binary Outcome
2
From November 14 th Dr Sainani talked about how the math works for binomial data.
3
Binomial Code There is some SAS code on the website to show how to play around with binomial probabilities. Run the macro code first that is the part from: %macro binom(events, trials, prob); down to %mend; Then you just plug in the number of events, trials and probability and run this line: %binom(3, 5,.5);
4
Results The code kicks out two summary tables. One has descriptive statistics and the binomial probabilities plus a couple checks on whether or not you can use Z approximations of the confidence limits. Plug in several examples from the lecture on the 12 th and 14 th to validate the code.
5
Results (2) The code also give you the confidence limits around the probability: Search the SAS online documentation for proc reliability to see the details on the CLS and setting your own limits if you want say 90% CLs. support.sas.com/onlinedoc/913/docMainpage.jsp
7
The Easy Answer Once the macro has been run once you just need to run this line: %binom(2, 6,.551);
8
Math Stuff
9
Difference in Proportion Math 95% CI on the Difference = (Δ – 1.96 * SE) up to (Δ + 1.96 * SE)
10
RR Math
11
OR Math
12
Ummm… No Thanks If you don’t want to do the algebra by hand you don’t have to. SAS has can do all this work for you easily.
13
Relative Risks If you use SAS for analyses be sure to set your tables up correctly. You will recall that Dr. Sainani showed this take with a RR of 1.61 Smoker (E)Non-smoker (~E) Heart disease (D)2113 No Disease (~D)7987 100
14
Making the table There is an EG project showing how to make the data:
15
A Contingency Table Contingency table values have to be mutually exclusive counts. Swap these for real life!!!!!
16
Getting a Relative Risk (sort of) It does not give you the RR!
17
Rotate the table The risk factor was in the first column. Notice it is the same odds ratio.
18
Risk Differences Smoker (E)Non-smoker (~E) Heart disease (D)2113 No Disease (~D)7987 100
19
Risk Difference
20
Association
21
Expected values in Chi Square Which cells are above or below the expected values?
22
R Version This does a quick analysis then deletes the table. Rerun the code to keep the table.
23
Rerun these
25
Another Example This example is taken from Motulsky’s Intuitive Biostatistics (a book I highly recommend when you encounter people who HATE math). The data is from Cooper et al’s zidovudine (AZT) trial for people who are HIV+. –76 of 475 on AZT had disease progress –129 of 461 on placebo had disease progress
26
The effect 76/475 or 16% progression vs. 129/461 or 28%. Is the 12% reduction a significant difference?
27
Grouped Data
28
The percents you care about The difference you care about The bad thing is in column 1
29
Important stuff Your subjects have to be randomly selected (independent from each other) from the population you wish to generalize to and the only differences between the two groups should be exposure to the risk factor (in a cohort study) or treatment (in a trial).
30
Beyond the Relative Risk Epidemiologists get very excited about relative risks but look at the overall prevalence. –A risk factor that changes the risk from 1 in 1,000,000 to 2 in 1,000,000 is not too important compared to a risk factor that changes the risk from 1 in 10 to 2 in 10 but the relative risk is the same. The relative risk is the same.5 for both risk factors.
31
NNT The number needed to treat (NNT) is the reciprocal of the difference in the probabilities between the two groups. It gives you a metric to judge the relative importance of the effects. In this case you need to treat a million people to made a difference in the rare disease vs 10. Risk of 1 in 1,000,000 = Risk of 2 in 2,000,000 =
32
Probability vs Odds So far I have talked about probabilities using the number of people progressing while on AZT relative to all the people on it. You can also look at odds by make a ratio of people progressing while on AZT to those who are not progressing on AZT Odds are not easy to think about and because of this not ideal for this data.
33
Relative Risk vs. Odds Ratio Relative Risk Odds Ratio
34
Why mess around with odds? If your disease/outcome of interest is rare you will not want to study hundreds of thousands of exposed people to find the few who get disease. You will want to find people with disease and match them to controls and then look to see if they were exposed. –This is a retrospective case-control study.
35
Dangers of RR You can get any relative risk you want by sampling different numbers of cases and controls in the case-control study!
36
Get 100 times the controls Get 100 times the cases The original study of cat scratch fever
37
Rare diseases If the disease is rare then the odds ratio approximates the relative risk.
38
Case Control Finding the right controls is VERY tricky. Take a class in epidemiology from Dr. Rita Popat to learn about the problems associated with the different types of controls.
39
Contingency Table Analyses You have seen contingency tables used to describe many kinds of studies. –Experiments –Cohorts –Case-Control studies Contingency tables are also used to describe results of lab results. –You will see a new test which calls people sick or not sick and you will have a gold standard. You want statistics to describe how good the new test does.
40
Screening and Diagnostic Sensitivity - correctly calling people sick when they are. Specificity - correctly calling people healthy when they are. Predictive value of a positive test - the percentage of people who are positive given a positive test result Predictive value of a negative test - the percentage of people who are negate given a negative test result.
41
Testing Formals sensitivity = 100 * a /(a+c) specificity = 100 * d / (b+d) predictive value of positive = 100 * a/(a+b) predictive value of negative = 100 * d/(c+d) Given half a chance I will mess up the algebra so I wrote code to do it.
42
Reading from the Bible Fleiss wrote the authoritative book on categorical data analysis (Statistical Methods for Rates and Proportions, 3rd Edition 2003 Fleiss, Levin, Paik). Get a copy if you are going to deal with categorical data in real life. I have coded up a lot of the book so you don’t need to think how to code up what goes with the brilliant prose. www.stanford.edu/class/hrp223/2003/Fleiss/ www.stanford.edu/class/hrp223/2003/Fleiss/
43
Using the Code
44
McNemar’s Test If you have pairs of matched data points (husband and wife saying yes/no, right eye vs. left eye vision good yes/no) you will want to measure the association considering that the pairs of data points are related. You can do McNemar’s test to see if there is an association in the paired data.
46
Agreement If you want to look at the degree of agreement between two raters you need a statistic that considers how frequently the people would agree by chance alone. You use the same SAS or EG code.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.