1 / 46

Doing Analyses on Binary Outcome

Doing Analyses on Binary Outcome. From November 14 th. Dr Sainani talked about how the math works for binomial data. 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:

kelii
Download Presentation

Doing Analyses on Binary Outcome

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Doing Analyses on Binary Outcome

  2. From November 14th • 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 12th and 14th 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

  6. The Easy Answer • Once the macro has been run once you just need to run this line: %binom(2, 6, .551);

  7. Math Stuff

  8. Difference in Proportion Math 95% CI on the Difference = (Δ – 1.96 * SE) up to (Δ + 1.96 * SE)

  9. RR Math

  10. OR Math

  11. 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.

  12. Smoker (E) Non-smoker (~E) Heart disease (D) 21 13 No Disease (~D) 79 87 100 100 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

  13. Making the table • There is an EG project showing how to make the data:

  14. Swap these for real life!!!!! A Contingency Table • Contingency table values have to be mutually exclusive counts.

  15. Getting a Relative Risk (sort of) • It does not give you the RR!

  16. Rotate the table • The risk factor was in the first column. • Notice it is the same odds ratio.

  17. Smoker (E) Non-smoker (~E) Heart disease (D) 21 13 No Disease (~D) 79 87 100 100 Risk Differences

  18. Risk Difference

  19. Association

  20. Expected values in Chi Square • Which cells are above or below the expected values?

  21. R Version • This does a quick analysis then deletes the table. Rerun the code to keep the table.

  22. Rerun these

  23. 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

  24. The effect • 76/475 or 16% progression vs. 129/461 or 28%. Is the 12% reduction a significant difference?

  25. Grouped Data

  26. The percents you care about The difference you care about The bad thing is in column 1

  27. 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).

  28. 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.

  29. 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 =

  30. 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.

  31. Relative Risk vs. Odds Ratio • Relative Risk • Odds Ratio

  32. 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.

  33. Dangers of RR • You can get any relative risk you want by sampling different numbers of cases and controls in the case-control study!

  34. The original study of cat scratch fever Get 100 times the controls Get 100 times the cases

  35. Rare diseases • If the disease is rare then the odds ratio approximates the relative risk.

  36. 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.

  37. 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.

  38. 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.

  39. 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.

  40. 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/

  41. Using the Code

  42. 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.

  43. 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.

More Related