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!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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