<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Interpolation for Intercensal Years in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602564#M76434</link>
    <description>&lt;P&gt;Okay, linear interpolation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So how would you do a linear interpolation? If the population was 2500 in 2002 and 3000 in 2007, then using paper and pencil, or doing it in your head, what is the interpolated value for 2003? What's the formula?&lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2019 19:38:40 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-11-07T19:38:40Z</dc:date>
    <item>
      <title>Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602554#M76431</link>
      <description>&lt;P&gt;Greetings SAS Community!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm conducting a study where I intend to calculate direct standardized rates for an outcome of interest. I need to interpolate/forecast the counts, represented as "total_count" in the sample data set, for the years between 2002 and 2007 - hopefully for age-specific and gender stratum.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Software = SAS 9.4:&amp;nbsp; I've used PROC TRANSREG, but I do not think it is designed for interpolation. Other posts discuss using PROC FORECAST, ESM or an ARRAY. However, I'v been unsuccessful using the later.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;-Paul&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 19:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602554#M76431</guid>
      <dc:creator>psnorrod</dc:creator>
      <dc:date>2019-11-07T19:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602562#M76432</link>
      <description>&lt;P&gt;Are you talking about &lt;STRONG&gt;linear&lt;/STRONG&gt; interpolation? If so, then this is a simple formula in a SAS data step.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 19:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602562#M76432</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-07T19:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602563#M76433</link>
      <description>&lt;P&gt;Hi Paige! Yes, linear interpolation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 19:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602563#M76433</guid>
      <dc:creator>psnorrod</dc:creator>
      <dc:date>2019-11-07T19:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602564#M76434</link>
      <description>&lt;P&gt;Okay, linear interpolation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So how would you do a linear interpolation? If the population was 2500 in 2002 and 3000 in 2007, then using paper and pencil, or doing it in your head, what is the interpolated value for 2003? What's the formula?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 19:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602564#M76434</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-07T19:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602569#M76435</link>
      <description>&lt;P&gt;Have you looked at PROC EXPAND?&amp;nbsp; It should provide interpolated, regularly-spaced (i.e. yearly in your case) record between the years you already have in your data.&amp;nbsp; It provides a wide variety of interpolation rules, although I suspect you merely want linearly interpolated values of TOTAL_COUNT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in your case, you only have two time-points (2002 and 2007) for each state*sex*age_group, so the minimal-learning effort is probably just a data step, as in:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want (drop=_:);
  set 'c:\temp\sample_data.sas7bdat';
  by state descending sex age_group;
  retain _total2002;
  if first.age_group then do;
    _total2002=total_count;
	output;
  end;
  else do;
    _total2007=total_count;
	_change=_total2007-_total2002;
	do year=2003 to 2007;
	  total_count= _total2002 + round(_change*(year-2002)/5);
	  if year=2007 then total_count=_total2007;
	  output;
	end;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I belatedly realized I broke up a teaching session.&amp;nbsp; Apologies to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 19:54:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602569#M76435</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2019-11-07T19:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602571#M76436</link>
      <description>&lt;P&gt;In short, the answer is 100. (y1-y0)/(x1-x0)&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 22:23:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602571#M76436</guid>
      <dc:creator>psnorrod</dc:creator>
      <dc:date>2019-11-08T22:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602573#M76437</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Proc Expand&lt;/STRONG&gt; is specialized in time series interpolation. Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc expand data=sample_data factor=5 out=sample_full;
by state descending sex age_group;
id year;
convert total_count;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602573#M76437</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-11-07T20:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602574#M76438</link>
      <description>&lt;P&gt;Hi mkeintz,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did not try PROC EXPAND. New to SAS.&lt;/P&gt;&lt;P&gt;For my overall data, my time points are 2002. 2007, 2012, and 2017 with 32 states in each year which equates to 1974 observations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Paul&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:01:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602574#M76438</guid>
      <dc:creator>psnorrod</dc:creator>
      <dc:date>2019-11-07T20:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602581#M76439</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202926"&gt;@psnorrod&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Greetings SAS Community!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm conducting a study where I intend to calculate direct standardized rates for an outcome of interest. I need to interpolate/forecast the counts, represented as "total_count" in the sample data set, for the years between 2002 and 2007 - hopefully for age-specific and gender stratum.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Software = SAS 9.4:&amp;nbsp; I've used PROC TRANSREG, but I do not think it is designed for interpolation. Other posts discuss using PROC FORECAST, ESM or an ARRAY. However, I'v been unsuccessful using the later.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;-Paul&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If discussing US population then the Census Bureau creates annual data sets of population estimates by age, race and gender.&lt;/P&gt;
&lt;P&gt;Start at&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.census.gov/programs-surveys/popest.html" target="_blank"&gt;https://www.census.gov/programs-surveys/popest.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and look around.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From a certain amount of experience the annual estimates are not simple linear estimates.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602581#M76439</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-07T20:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Interpolation for Intercensal Years</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602584#M76440</link>
      <description>&lt;P&gt;Unfortunately, I'm not using Census Bureau data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Interpolation-for-Intercensal-Years/m-p/602584#M76440</guid>
      <dc:creator>psnorrod</dc:creator>
      <dc:date>2019-11-07T20:12:01Z</dc:date>
    </item>
  </channel>
</rss>

