turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- which is dependent variable (proc GENMOD)

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-16-2011 05:53 PM

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.

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-17-2011 12:56 PM

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;

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;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-20-2011 11:01 AM

Thanks Dale. The code you provided worked! I appreciate your help.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-20-2011 05:05 PM

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

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