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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1516 views
  • 0 likes
  • 2 in conversation