BookmarkSubscribeRSS Feed
andreaat
Calcite | Level 5

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 🙂 

1 REPLY 1
DarthPathos
Lapis Lazuli | Level 10

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

Has my article or post helped? Please mark as Solution or Like the article!

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2719 views
  • 0 likes
  • 2 in conversation