From: php67 on
I want to create age adjusted death rates by zip code. Was hoping some
code might be available to easily modify for my use.
From: Mike Zdeb on
hi ... here's an example ... direct age adjusting using the 2000 census standard population
it assumes that you have deaths and populations in 11 age groups ...

* the age groups;
proc format;
value age
0 = '1'
1-4 = '2'
5-14 = '3'
15-24 = '4'
25-34 = '5'
35-44 = '6'
45-54 = '7'
55-64 = '8'
65-74 = '9'
75-84 = '10'
85-high = '11'
;
run;



* once you have the data;
data deaths;
input zip d1-d11;
datalines;
10001 28 2 7 23 23 74
159 245 468 951 984
10002 6 1 2 5 2 18
26 49 108 136 134
;
run;

data pops;
input zip p1-p11;
datalines;
10001 3192 13457 38376 44836 39421 45513
42201 24975 20783 15826 5985
10002 528 2270 7133 9987 5040 6902
6505 4562 3748 2328 924
;
run;

* combine deaths and populations;
data both;
merge deaths pops;
by zip;
run;

* crude and direct age adjusted rates per 1,000 population;
data rates;
set both;
array adj(11) _temporary_ (.013818 .055317 .145565 .138646 .135573 .162613
.134834 .087247 .066037 .044842 .015508);
array d(11);
array p(11);

d0 = sum(of d:);
p0 = sum(of p:);

r_crude = 1000 * d0 / p0;

do j=1 to 11;
r_adj = sum(r_adj, adj(j)*d(j)/p(j) );
end;

r_adj = 1000*r_adj;

label
d0 = 'DEATHS'
p0 = 'POPULATION'
r_crude = 'CRUDE DEATH RATE'
r_adj = 'AGE ADJUSTED DEATH RATE'
;

format d0 p0 comma7. r_: 5.1 ;
keep zip d0 p0 r_: ;
run;

proc print data=rates label noobs;
run;

CRUDE AGE
DEATH ADJUSTED
ZIP DEATHS POPULATION RATE DEATH RATE
10001 2,964 294,565 10.1 8.7
10002 487 49,927 9.8 9.0



if you'd like to do some reading ...

http://www.albany.edu/~msz03/epi697/ho/adjust.pdf


--
Mike Zdeb
U(a)Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475

> I want to create age adjusted death rates by zip code. Was hoping some
> code might be available to easily modify for my use.
>
From: "Keintz, H. Mark" on
By "age adjusted", I presume you mean death rates by age group. Since you want this for each zip code, I presume you not only have death COUNTS by age group for each zip code, but also total population by age group, also by zip code.

Assuming you have these data, or the antecedents to them (maybe you have individual death records by age), SAS-L can easily provide an answer.

But to get the optimal answer, give us a better description of the data you have.

Regards,
Mark

> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L(a)LISTSERV.UGA.EDU] On Behalf Of
> php67
> Sent: Thursday, February 11, 2010 1:40 PM
> To: SAS-L(a)LISTSERV.UGA.EDU
> Subject: Age adjustment by zip code
>
> I want to create age adjusted death rates by zip code. Was hoping some
> code might be available to easily modify for my use.
 | 
Pages: 1
Prev: Join data horizontally
Next: Untitled