Hello,
1. I am creating 2 different groups; refgroupA and refgroup B.I have been able to create refgroupA but I would need assistance for refgroup B. Refgroup B in the results(attached) is incorrect.
There are 3 agents (a1exp,a2exp and a3exp), their levels and categories of exposures. 0=unexposed, 1 is exposed with levels 1=high and 2=low.
Refgroup A are ids(cases and controls(cont) not exposed to agent 1(a1exp): ie. a single reference group used for the evaluated agents (a2exp and a3exp).
Refgroup B are ids exposed to agent 1(a1exp) but not to agent under analysis ie. a2exp and a3exp.[Actually there are many agents but I am using only 3 of them as a test].
The idea of these refgroups is to check of the ORs are lower when using refgroup A in the analysis, in comparison with ORs obtained with regroup B.
refgroupB created is not right because ids exposed to a1exp not a2exp are os2, os6 and os12;
Ids exposed to a1exp not a3exp are os4,os6 and os13. Help needed here, please for the refgroupB.
2. Help also needed when using refgroupA and refgroupB in analysis to be able to fill in the OR table (Table 3) attached.
? After creating the refgroups, do I have to merge the regroup results with original data(expinfo) to be able to fill in the table? I have no clue. Please help.
Thanks. ak.
data expinfo;
input id$ 1-4 a1exp 6-7 a1exp_level$ 8-17 a1exp_cat 19-20
a2exp 26-27 a2exp_level$ 28-32 a2exp_cat 39-40 a3exp 46-47 a3exp_level$ 48-50 a3exp_cat 59-60
lung$ 68-72;
datalines;
os1 0 unexposed 0 1 high 1 0 unexposed 0 case
os2 1 low 2 0 unexposed 0 1 low 2 case
os3 0 unexposed 0 0 unexposed 0 0 unexposed 0 case
os4 1 high 1 1 low 2 0 unexposed 0 cont
os5 0 unexposed 0 0 unexposed 0 1 high 1 cont
os6 1 low 2 0 unexposed 0 0 unexposed 0 case
os7 1 low 2 1 high 1 1 low 2 case
os8 0 unexposed 0 0 unexposed 0 0 unexposed 0 case
os9 0 unexposed 0 0 unexposed 0 0 unexposed 0 cont
os10 1 high 1 1 low 2 1 low 2 cont
os11 0 unexposed 0 0 unexposed 0 1 high 1 case
os12 1 low 2 0 unexposed 0 1 high 1 case
os13 1 high 1 1 low 2 0 unexposed 0 case
os14 0 unexposed 0 0 unexposed 0 0 unexposed 0 cont
os15 0 unexposed 0 0 unexposed 0 0 unexposed 0 cont
os16 1 high 1 1 low 2 1 high 1 cont
os17 0 unexposed 0 1 high 1 1 low 2 cont
os18 0 unexposed 0 0 unexposed 0 0 unexposed 0 cont
;
run;
proc freq data=expinfo; where a1exp=0;
tables lung;
title 'Table 1:Subjects unexposed to a1exp';
run;
proc sql;
create table t as
select
id, a1exp, a2exp,a3exp,lung,
a1exp=0 as refgroupA,
a1exp ne 0 and a2exp=0 and a1exp ne 0 and a3exp=0 as refgroupB
from expinfo
;
quit;
proc print data=t;
title 'Table 2: original variables and refgroupA and refgroupB;
refgroupB is not correct';
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.