BookmarkSubscribeRSS Feed
rachel347
Calcite | Level 5

I have age-specific rates that are in 5-year age intervals that I want to interpolate to rates for single-years of age. In the past I've done this in excel. Is proc expand the correct procedure? I only see info on changing things from monthly to daily, etc and not from 5-year to 1-year rates.

Thanks in advance for any guidance.

2 REPLIES 2
Ksharp
Super User

Yeah. I think proc expand can do  that.

Make a year variable.

year

1

2

..

and put it in ID statement of proc expand.

rachel347
Calcite | Level 5

Thank you, Xia, for your help.

In case anyone is wondering what I ended up doing, here is what I did. The results are very close to the data that I was getting when I did the interpolation in excel. 

/*I created an empty dataset with all the ages by 1 so that I would have the correct ages to fill in with the interpolated data:*/

data padded;

do age=15 to 44 by 1;

output;

end;

run;

/*Then I merged that dummy data set onto my data set that had my 5-year fertility rates:*/

data pad;

  merge padded work.fert_rates_2012;

  by age;

run;

/*Then this is the expand options that I used. The convert has the two fertility rate variables--one for hispanic one for non-hispanic and used the age variable as the ID.*/

proc expand data=pad out=expanded method = spline(natural)

extrapolate;

id age;

convert hisp_irate nonhisp_irate;

run;

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 815 views
  • 3 likes
  • 2 in conversation