Finding the Odds ratio at different levels of chemicals
Hello, can someone please help me to find all the odds ratio of different levels of reliability, a1_reliab(1=possible,2=probable, and 3= certain) and concentration, a1_conc (1=low, 2= medium and 3 = high) of individuals exposed to a chemical a1 (0= unexposed and 1= exposed).
The OR is for the association between a chemical a1(exposure of interest) and stomach cancer, the response variable (with cases(ca case) and population controls(pop cont)).
I already calculated the OR between a1 and the stomach cancer using unexposed subjects as a reference, but I would like SAS logistic regression to calculate the ORs at all individual levels(1,2 and 3) for a1_reliab and a1_conc, but it did not; it gave me only ORs at two levels each for
I wouldn’t want SAS to use any of the levels as reference to compute the ORs at each level.
proc logistic data=chem2;
class a1_reliab (param=ref ref ='1'); a1_conc (param=ref ref ='1');
model lung(event='ca case') = a1_reliab a1_conc; run;
Thank you for your expert assistance.
ak.
/* Exposure to chemicals*/
data chem1;
input id$ a1 a1_reliab a1_conc lung$ 14-21;
datalines;
os1 1 3 2 1 ca case
os2 1 1 1 0 ca case
os3 0 2 3 0 pop cont
os4 1 1 1 1 pop cont
os5 0 1 1 0 ca case
os6 0 3 3 0 ca case
os7 1 1 3 1 pop cont
os8 0 2 3 0 ca case
os9 1 2 1 0 pop cont
os10 0 3 1 0 ca case
os11 0 1 2 0 pop cont
os12 0 2 2 0 pop cont
os13 1 1 2 1 pop cont
os14 0 3 3 0 pop cont
os15 1 3 1 1 ca case
os16 0 2 3 0 pop cont
os17 1 1 1 1 pop cont
os18 0 3 2 0 pop cont
os19 0 1 3 0 pop cont
os20 0 3 1 0 pop cont
os21 0 2 1 0 pop cont
os22 1 2 1 0 ca case
;
run;
proc print data=chem1;
title 'Table 1:Sujects exposures to chemicals';
run;
data chem2; set chem1;
if lung in ('ca case','pop cont');
run;
proc format;
value a1_reliab 1='possible' 2='probable' 3='certain';
value a1_conc 1='low' 2='medium' 3='high';
proc logistic data=chem2;
class a1_reliab (param=ref ref ='1');
model lung(event='ca case') = a1_reliab;
title 'Table 2: ORs at different levels of reliability';
run;
proc logistic data=chem2;
class a1_conc (param=ref ref ='1');
model lung(event='ca case') = a1_conc;
title 'Table 3: ORs at different levels of concentration';
run;
I don't think you are understanding the concept of an odds ratio... it compares the odds of two levels of a predictor. As a ratio, it is the odds of the event for one level divided by the odds of the event for another level. It fundamentally does not apply to one, and only one, level. The code I provided gives the odds ratios among all possible pairs of levels within each predictor. Perhaps you need to rethink exactly what it is you are looking for.
Use ODDSRATIO statements. See the PROC LOGISTIC documentation.
proc logistic;
class a1_reliab (param=ref ref ='1') a1_conc (param=ref ref ='1');
model lung(event='ca case') = a1_reliab a1_conc;
oddsratio a1_reliab;
oddsratio a1_conc;
run;
I don't think you are understanding the concept of an odds ratio... it compares the odds of two levels of a predictor. As a ratio, it is the odds of the event for one level divided by the odds of the event for another level. It fundamentally does not apply to one, and only one, level. The code I provided gives the odds ratios among all possible pairs of levels within each predictor. Perhaps you need to rethink exactly what it is you are looking for.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.