Appreciate and thank you in advance for your help.
I want to do predictive numbers from the age groups as below in 2018:
<30 years: 200
30-39 years: 450
40-49 years: 330
50+ years: 175
In the next ten year (2028), assuming no deaths in each age group, if there is 25% in the age group <30 years will be aged 30-39 years, 25% in the age group 30-39 years will be aged 40-49 years, and 25% in the age group 40-49 years will be aged 50+ years. The bottom line is to estimate the number of those who are in the age group 50+ years.
I use SAS studio.
Phan S.
Just work the result table a little more as follows.
proc sql;
create table want1 as
select group, coalesce(age30_2028,age39_2028,age49_2028,age50_2028) as people_2028
from want;
run;
data want_final;
set want1;
retain total;
total=sum(people_2028,total);
run;
the sum of all the groups is the one in the last row.
The code is simple, but it should work.
data have;
input group :$15. People;
datalines;
30years 200
30-39years 450
40-49years 330
50+years 175
;
run;
data want;
set have nobs=count_obs;
retain val;
if group='40-49years' then val=people;
if group='50+years' then do;
people_2028=0.25*val+people;
output;
end;
keep group people_2028;
run;
The group of 40-49 years should be before the group if 50+.
Just work the result table a little more as follows.
proc sql;
create table want1 as
select group, coalesce(age30_2028,age39_2028,age49_2028,age50_2028) as people_2028
from want;
run;
data want_final;
set want1;
retain total;
total=sum(people_2028,total);
run;
the sum of all the groups is the one in the last row.
It can be done using Markov chains, but given the simplicity of the problem I wouldn't use that.
Its possible that you don't have the required license.
Check the the following link to see how to check that.
I don´t have that product.
you could try making another post, maybe someone else can help you with that.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.