Prev: ODS to multiple Excel worksheets - sheet_name option not
Next: Creating a message in Lotus Notes
From: Robin R High on 12 Oct 2009 10:17 Thomas, Without commenting on the code or design you sent, or whether it applies to your specific data, it is possible to get a relative risk close to 1 and an odds ratio far from 1 if the response of interest is very common, e.g., examine the following counts: ----------------------------------------- |Counts | Response | Response | |and |-------------+---------------| |Percents | 1 | 0 | 1 | 0 | | |------+------+-------+-------| | | N | N | Row % | Row % | |---------+------+------+-------+-------| |Gender | | | | | |1 | 96| 4| 96.0| 4.0| |0 | 99| 1| 99.0| 1.0| ----------------------------------------- StudyType Value Case-Control (Odds Ratio) 0.2424 -- far from 1 Cohort (Col1 Risk) 0.9697 -- close to 1 If you compute these with genmod LR Statistics For Type 3 Analysis ...for odds ratio, get a smaller pvalue Chi- Source DF Square Pr > ChiSq gender 1 1.97 0.1601 ...for relative risk pvalue much larger Chi- Source DF Square Pr > ChiSq gender 1 0.05 0.8299 Robin High UNMC From: Thomas Fr�jd <thomas.frojd(a)NEURO.UU.SE> To: SAS-L(a)LISTSERV.UGA.EDU Date: 10/12/2009 04:55 AM Subject: Relative risk and odds ratio, OR significant and above 1, RR not Sent by: "SAS(r) Discussion" <SAS-L(a)LISTSERV.UGA.EDU> Hi, I am performing a logistic regression for Odds Ratio as result and a Poisson regression with log link for RR, both with proc genmod. The design is a cohort study with two timepoints sampled so far. A thing that confounds me is that one of the covariates has a pretty strong and significant effect when regressing for Odds Ratio but then points to a negative but unsignificant when regressing for Relative Risk. Anyone can explain why to me?
From: Sigurd Hermansen on 12 Oct 2009 23:15 >> I'm confused, though, by a few things: >> 1. Why are you considering a Poisson model for a dichotomous outcome? >> >The short answer is that I read about it here >http://www.ats.ucla.edu/stat/sas/faq/relative_risk.htm >Seems to be the best way to get relative risk in SAS. >> 2. Why do you have a REPEATED statement only in the Poisson model? >> >It is a workaround telling proc genmod to calculate the robust errors. >The site above say it is mandatory. ..... >> 4. Why do you expect RR and OR to be the same? Particularly when the event is rare, they can differ by a lot. >> >You are probably right. I expect RR to be at least above 1 since OR is >1.37 with confidence interval above 1. However RR is actualy estimated >as lower than 1, 0.95 to be precise. I have 600 "cases" that are >reasonably evenly distributed across the covariates and a total sample >of 3000 but maybe the effect is too small to measure even with such a >generous sample. Thomas: Robin High has demonstrated how OR and RR can have very different values where the probability of an event exceeds 5%. Here's an example of how to adapt the examples you found at the UCLA site to your context: libname lib "H:/My Documents/SASPrograms"; data eyestudy; set lib.eyestudy; run; proc means data = eyestudy maxdec = 2; var carrot gender latitude lenses; run; proc freq data = eyestudy; tables carrot*lenses/nopercent nocol; run; proc genmod data = eyestudy descending; class carrot; model lenses = carrot/ dist = binomial link = logit; estimate 'Beta' carrot 1 -1/ exp; run; proc genmod data = eyestudy descending; class carrot; model lenses = carrot/ dist = binomial link = log; estimate 'Beta' carrot 1 -1/ exp; run; /* Relative risk estimation by Poisson regression with robust error variance Zou ([2]) suggests using a “modified Poisson” approach to estimate the relative risk and confidence intervals by using robust error variances. Using a Poisson model without robust error variances will result in a confidence interval that is too wide. The robust error variances can be estimated by using the repeated statement and the subject identifier (here id), even if there is only one observation per subject, as Zou cleverly points out. Here is how it is done: */ proc genmod data = eyestudy; class carrot id; model lenses = carrot/ dist = poisson link = log; repeated subject = id/ type = unstr; estimate 'Beta' carrot 1 -1/ exp; run; /* Adjusting the relative risk for continuous or categorical covariates Adjusting the RR for other predictors or potential confounders is simply done by adding them to the model statement as you would in any other procedure. Here gender and latitude will be added to the model: */ proc genmod data = eyestudy; class carrot gender id; model lenses = carrot gender latitude/ dist = poisson link = log; repeated subject = id/ type = unstr; estimate 'Beta Carrot' carrot 1 -1/ exp; estimate 'Beta Gender' gender 1 -1/ exp; estimate 'Beta Latitude' latitude 1 -1/ exp; run; /* Modified suicide example .... In a new dataset rename lenses to suicide_t2 and carrot to exposure. */ proc sql; create table test as select lenses as suicide_t2,carrot as exposure,id from eyestudy ; quit; PROC genmod DATA=&syslast descending ; CLASS suicide_t2 exposure ; MODEL suicide_t2 = exposure / dist= bin link=logit ; estimate 'OR exposure' exposure -1 1 / e exp; ; RUN; QUIT; PROC genmod DATA=&syslast descending ; CLASS suicide_t2 exposure ; MODEL suicide_t2 = exposure / dist= bin link=logit ; estimate 'OR exposure' exposure -1 1 / e exp; ; RUN; QUIT; /* code for Relative risk model: */ PROC genmod DATA=&syslast ; CLASS suicide_t2 exposure id ; MODEL suicide_t2 = exposure / dist= poisson link=log ; repeated subject = id/ type = unstr; estimate 'RR exposure' exposure -1 1 / e exp; ; RUN; QUIT; The UCLS sample data have these cross-frequencies: Frequency| Row Pct | 0| 1| Total ---------+--------+--------+ 0 | 17 | 32 | 49 | 34.69 | 65.31 | ---------+--------+--------+ 1 | 30 | 21 | 51 | 58.82 | 41.18 | ---------+--------+--------+ Total 47 53 100 Since the event does not have a small probability, the OR will not approximate the RR. OR estimate: Mean Mean L'Beta Standard L'Beta Label Estimate Confidence Limits Estimate Error Alpha Confidence Limits OR exposure 0.2711 0.1419 0.4555 -0.9892 0.4136 0.05 -1.7997 -0.1786 Exp(OR exposure) 0.3719 0.1538 0.05 0.1653 0.8364 RR estimate: Mean Mean L'Beta Standard L'Beta Label Estimate Confidence Limits Estimate Error Alpha Confidence Limits RR exposure 0.6305 0.4285 0.9278 -0.4612 0.1971 0.05 -0.8476 -0.0749 Exp(RR exposure) 0.6305 0.1243 0.05 0.4285 0.9278 Though substantially different, the estimates align. S -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L(a)LISTSERV.UGA.EDU] On Behalf Of Thomas Fröjd Sent: Monday, October 12, 2009 10:28 AM To: SAS-L(a)LISTSERV.UGA.EDU Subject: Re: Relative risk and odds ratio, OR significant and above 1, RR not Hi again, I answer below. <snip>
|
Pages: 1 Prev: ODS to multiple Excel worksheets - sheet_name option not Next: Creating a message in Lotus Notes |