Hello,
I'm looking for help with my SAS code from anyone who is willing to provide advice! I am not an expert with code, so you will have to really dumb it down and be clear about what I should do.
I am using a large survey dataset of 30,000 people. I am using SAS Studio University edition.
Exposure: Obesity (binary categorical: 0=not obese, 1=obese)
Outcome: visit to a doctor (binary categorical: 0=no, 1=yes)
I want to adjust my data for various confounders and my data needs to be weighted. I have previously used a strata and weight statement when computing odds ratios using 'proc surveylogistic', and I know that I weighted my data properly.
QUESTION #1: What proc statement should I use to compute adjusted and weighted risk ratios? (please provide me with clear code where I can just put in my variables, I won't understand if you try and explain it to me)
QUESTION #2: I have tried to use PROC GENMOD with weights and without adjusting for any confounders but Im running into warning a statement.
proc genmod data= DATASET ;
class OBESITY (ref='0') DOCTOR (ref='0');
model DOCTOR (event='1')=OBESITY / dist = binomial link = log;
strata WEIGHT_GEO;
weight WEIGHT_ANALYTIC;
estimate 'Beta' OBESITY 1 -1/ exp;
run;
The warning statement I'm getting when I run this is:
WARNING: The STRATA statement is valid only for an exact analysis specified with an EXACT statement. The statement is ignored.
I am not sure how to write an exact statement or where it should go in my code.
PLEASE HELP ASAP!!!!
Thank you 🙂
Hi @andreaat - I'm not extremely comfortable with PROC GENMOD but found this article (https://academic.oup.com/aje/article/162/3/199/171116) which provides the following code. The authors also provide a link to a macro that should help. Hopefully this answers your question. If you can post your sample data, that'll help any other members answer your question.
proc genmod descending;
model death=receptor stage2 stage3/dist=bin link=log;
estimate ‘RR receptor low vs. high’ receptor 1/exp;
estimate ‘RR stage2 vs stage1’ stage2 1/exp;
estimate ‘RR stage 3 vs stage1’ stage3 1/exp;
Chris
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.