BookmarkSubscribeRSS Feed
RyanD
Fluorite | Level 6
I'm trying to determine the prevalence of risk factors in a Black population compared to a reference group, but I can't figure out if the risk factor is the dependent or independent variable.

For example (Here's my 2X2 table):
____________Risk Factor
____________Yes__________No
-------------------------------------------------------
Black________34_________99,966_______100,000
RefPop_______26_________99,974_______100,000
--------------------------------------------------------
Total_________60________199,940_______200,000

I've been calculating the RR as (34/100,000)/(26/100,000)=1.3

I interpret this to mean that the Black population is 1.3 times as likely to smoke (one of the risk factors) as the reference population.

However, when I test using proc GENMOD (NOTE: next step is to include covariates, but I wanted to test it to see if the calculated RR using a single risk factor matched my 2X2 table above) I can't get it to calculate the RR I got above (1.3). However, it does calculate to the alternative RR (34/60)/(99,966/199,940)=1.13

Here's my SAS code:

proc genmod data=dataset1;
class RiskFactor (ref='1') /param=ref;
model RefPop = RiskFactor / link=log dist=bin;
estimate 'Beta RiskFactor ' RiskFactor 1 -1/ exp;
run;

(Note: RefPop = 0 indicates Black, RiskFactor=1 indicates risk factor present)

This seems like a really fundamental concept that I can't wrap my head around in this case. What am I doing wrong?

To take this one step further, I've planned to set up the multivariate analysis like this:

proc genmod data=dataset1;
class RiskFactor1 (ref='1') RiskFactor2 (ref='2') RiskFactor3 (ref='1') /param=ref;
model RefPop = RiskFactor1 RiskFactor2 RiskFactor3 / link=log dist=bin;
estimate 'Beta RiskFactor1 ' RiskFactor1 1 -1/ exp;
estimate 'Beta RiskFactor2 ' RiskFactor2 1 -1/ exp;
estimate 'Beta RiskFactor3 ' RiskFactor3 1 -1/ exp;
run;

Is this correct?

Thanks for your help.
3 REPLIES 3
Dale
Pyrite | Level 9
Ryan,

You do, indeed, have your independent and dependent variables turned around in your genmod code. Your regression model would suggest that the risk factor can affect whether a respondent is black or not. This is a strange notion indeed!

You can get the RR of 1.3 with the following code:

proc genmod data=test desc;
  class RefPop (ref='1') /param=glm;
  model RiskFactor = RefPop / link=log dist=bin;
  estimate 'Beta RefPop' RefPop 1 -1/ exp;
run;
RyanD
Fluorite | Level 6
Thanks Dale. The code you provided worked! I appreciate your help.
RyanD
Fluorite | Level 6
Hi Dale,

I'm getting an error message "Out of memory" when I run my code with the dist=poisson option. Do you know what's causing this or any work arounds?

Thanks,
Ryan

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

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.

Discussion stats
  • 3 replies
  • 1753 views
  • 0 likes
  • 2 in conversation