BookmarkSubscribeRSS Feed
psnorrod
Obsidian | Level 7

Hello All!

 

Emerging SAS user here. I want to calculate age and gender adjusted rates for each year of my study, and possible look at adjusted rates for each site as well. I've used PROC GENMOD to generate the least square means for my crude estimates, but cannot get my code to "adjust" the rates for each age and gender group. The reference groups in the data below are sex=1 and age_group=1.

 

I used the following code (see below) to calculate the unadjusted annual rates. However, I have attempted multiple iterations to adjust for age and gender without success. Finally, the "ln" was derived from the variable "denom_count" which is the denominator for my data which includes the same age and gender strata as the event data. I simply merged the two data sets using site specific codes. Thank you so much for your help and input!!!

 

/* Unadjusted Annual Rates */

proc genmod data=want;

class year;

model event_count = year / type3 dist=poisson link=log offset=ln;

lsmeans year / ilink cl e;

title ' Model 1: Crude Estimates by Year';

run;

 

Data Sample

Year state sex agegrp   event-count  denom_count             ln

2003  2     2     1               0                    113              4.727387819

2004  2     2     1               0                    115              4.744932128

2005  2     2     1               0                    116              4.753590191

2006  2     2     1               0                    118              4.770684624

2007  2     2     1               0                    120              4.787491743

2008  2     2     1                0                    117              4.762173935

2009  2     2     1                0                    114              4.736198448

2010  2     2     1                1                    112              4.718498871

2011  2     2     1                0                    109              4.691347882

2012  2     2     1                0                    106              4.663439094

2013  2     2     1                1                     123              4.812184355

2014  2     2     1                0                     141              4.94875989

2015  2     2     1                1                     158              5.062595033

2016  2     2     1                0                     176              5.170483995

2017  2     2     1                0                     193              5.262690189

2003  57     2     2                0                      371              5.916202063

2004  57     2     2                0                      378              5.934894196

2005  57    2     2                0                      385              5.953243334

2006  57     2     2                0                      392              5.97126184

 

 

 

 

7 REPLIES 7
ballardw
Super User

Can you give a bit of detail in what you mean by "adjust" or "adjusted rates" in this case?

 

There are several meanings in adjusting rates and some are done in Proc STDRATE, which documentation you may want to look at to see if this is what you want.

psnorrod
Obsidian | Level 7

Thanks @ballardw 

 

I have read the PROC STDRD documentation about a direct method of standardization, but I do not have person-time in this data set. I do have an age variable, which I suspect that I could calculate person-time using the accumulation of age within each age year and gender strata.

 

In terms of adjust, I should have used the term "modeling" rates. I want to hold the sex and age categories constant in the model to obtain a least square means of the rate that accounts for age and gender, similar to what's suggested in this SAS support article

 

Here is the output from the original post

code_example.JPG

I wrote this code earlier, and I think that it's holding age and gender constant in the model but not 100% certain.

 

proc genmod data=want;
class year sex(ref='1') age_group(ref='1');
model dec_count = year sex age_group / type3 dist=poisson link=log offset=ln;
lsmeans year / ilink cl e;
title ' Model 2: Annual Estimates Adjusted by Gender and Age';
run;

 

Here is the output from the code just above.

code_example2.JPG

 

Thank you.

psnorrod
Obsidian | Level 7

I got the model working and corrected the class statements and reference parameters. I now rates that are modeled and account for gender and age.

jaelee22
Fluorite | Level 6
Hello,
I am also doing an analysis that needs to be adjusted for age.
Could you share your knowledge with me? did you have to categories age by age groups?
psnorrod
Obsidian | Level 7

I created three categories for my age groups which were based on my study population.

khairul
Calcite | Level 5
Can you please share your codes? I need to calculate age-adjusted rates as well for 2003-2015 against the base year (2003) age structure. Plz help.
StatDave
SAS Super FREQ

The LSMEANS statement does hold the other model variables constant. By default, continuous variables are fixed at their means, and categorical variables are fixed at their reference levels. To see the values that are used, add the E option in the LSMEANS statement. See this on how LS-means are constructed. 

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
  • 7 replies
  • 2676 views
  • 0 likes
  • 5 in conversation