<?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: Predictive numbers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676283#M203904</link>
    <description>&lt;P&gt;I don´t have that product.&lt;/P&gt;
&lt;P&gt;you could try making another post, maybe someone else can help you with that.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2020 19:32:28 GMT</pubDate>
    <dc:creator>Angel_Larrion</dc:creator>
    <dc:date>2020-08-12T19:32:28Z</dc:date>
    <item>
      <title>Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676169#M203841</link>
      <description>&lt;P&gt;Appreciate and thank you in advance for your help.&lt;/P&gt;
&lt;P&gt;I want to do predictive numbers from the age groups as below in 2018:&lt;/P&gt;
&lt;P&gt;&amp;lt;30 years: 200&lt;/P&gt;
&lt;P&gt;30-39 years: 450&lt;/P&gt;
&lt;P&gt;40-49 years: 330&lt;/P&gt;
&lt;P&gt;50+ years: 175&lt;/P&gt;
&lt;P&gt;In the next ten year (2028), assuming no deaths in each age group, if there is 25% in the age group &amp;lt;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.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use SAS studio.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Phan S.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 14:05:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676169#M203841</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2020-08-12T14:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676204#M203857</link>
      <description>&lt;P&gt;The code is simple, but it should work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The group of 40-49 years should be before the group if 50+.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 15:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676204#M203857</guid>
      <dc:creator>Angel_Larrion</dc:creator>
      <dc:date>2020-08-12T15:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676237#M203883</link>
      <description>Hi Angel,&lt;BR /&gt;&lt;BR /&gt;I apply your code as below and it matches Excel outcomes.&lt;BR /&gt;Although the total is error - please see attached.&lt;BR /&gt;How to write a code for Total.  Thank you.&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;input group :$15. People;&lt;BR /&gt;datalines;&lt;BR /&gt;30years 200&lt;BR /&gt;30-39years 450&lt;BR /&gt;40-49years 330&lt;BR /&gt;50+years 175&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have nobs=count_obs;&lt;BR /&gt;retain val;&lt;BR /&gt;if group='30years' then val=people;&lt;BR /&gt;if group='30years' then do;&lt;BR /&gt;age30_2028=0.75*val;&lt;BR /&gt;end;&lt;BR /&gt;if group='30years' then val=people;&lt;BR /&gt;if group='30-39years' then do;&lt;BR /&gt;age39_2028=0.25*val+0.75*people;&lt;BR /&gt;end;&lt;BR /&gt;if group='30-39years' then val=people;&lt;BR /&gt;if group='40-49years' then do;&lt;BR /&gt;age49_2028=0.25*val+0.75*people;&lt;BR /&gt;end;&lt;BR /&gt;if group='40-49years' then val=people;&lt;BR /&gt;if group='50+years' then do;&lt;BR /&gt;age50_2028=0.25*val+people;&lt;BR /&gt;end;&lt;BR /&gt;total=age30_2028+age39_2028+age49_2028+age50_2028;&lt;BR /&gt;output;&lt;BR /&gt;keep group age30_2028 age39_2028 age49_2028 age50_2028 total;&lt;BR /&gt;run;</description>
      <pubDate>Wed, 12 Aug 2020 16:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676237#M203883</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2020-08-12T16:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676249#M203892</link>
      <description>&lt;P&gt;Just work the result table a little more as follows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the sum of all the groups is the one in the last row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 17:27:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676249#M203892</guid>
      <dc:creator>Angel_Larrion</dc:creator>
      <dc:date>2020-08-12T17:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676262#M203895</link>
      <description>Thank you, Angel.&lt;BR /&gt;Someone said I should do as a model calculation.&lt;BR /&gt;What do you think? If so, how can I write a model based on my dataset.&lt;BR /&gt;&lt;BR /&gt;Phan S.&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Aug 2020 17:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676262#M203895</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2020-08-12T17:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676266#M203897</link>
      <description>&lt;P&gt;It can be done using Markov chains, but given the simplicity of the problem I wouldn't use that.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 17:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676266#M203897</guid>
      <dc:creator>Angel_Larrion</dc:creator>
      <dc:date>2020-08-12T17:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676274#M203900</link>
      <description>Angel,&lt;BR /&gt;In my dataset, I want to draw a graph to predict a 25%, 50% and 75%&lt;BR /&gt;increase for each age group.&lt;BR /&gt;&lt;BR /&gt;I found this from SAS for Predictive values. I like the graph. I hope to&lt;BR /&gt;apply for my dataset.&lt;BR /&gt;But, I am not sure why I cannot run proc hpnlmod in my SAS Studio. The&lt;BR /&gt;Logfile says: Errors proc hpnlmod not found.&lt;BR /&gt;&lt;BR /&gt;Please explain. May I apply this procedure for mine?&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;Phan S.&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=stathpug&amp;amp;docsetTarget=stathpug_hpnlin_examples01.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=stathpug&amp;amp;docsetTarget=stathpug_hpnlin_examples01.htm&amp;amp;docsetVersion=14.2&amp;amp;locale=en&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data a;&lt;BR /&gt;   input y x @@;&lt;BR /&gt;   datalines;&lt;BR /&gt;.46 1  .47  2 .57  3 .61  4 .62  5 .68  6 .69  7&lt;BR /&gt;.78 8  .70  9 .74 10 .77 11 .78 12 .74 13 .80 13&lt;BR /&gt;.80 15 .78 16&lt;BR /&gt; ;&lt;BR /&gt;run;&lt;BR /&gt;proc hpnlmod data=a out=b;&lt;BR /&gt;   parms alpha=.45 beta=.05 gamma=-.0025;&lt;BR /&gt;&lt;BR /&gt;   x0 = -.5*beta / gamma;&lt;BR /&gt;&lt;BR /&gt;   if (x &amp;lt; x0) then&lt;BR /&gt;        yp = alpha + beta*x  + gamma*x*x;&lt;BR /&gt;   else&lt;BR /&gt;        yp = alpha + beta*x0 + gamma*x0*x0;&lt;BR /&gt;&lt;BR /&gt;   model y ~ residual(yp);&lt;BR /&gt;&lt;BR /&gt;   estimate 'join point' -beta/2/gamma;&lt;BR /&gt;   estimate 'plateau value c' alpha - beta**2/(4*gamma);&lt;BR /&gt;   predict 'predicted' yp pred=yp;&lt;BR /&gt;   predict 'response' y pred=y;&lt;BR /&gt;   predict 'x' x pred=x;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data=b noautolegend;&lt;BR /&gt;   yaxis label='Observed or Predicted';&lt;BR /&gt;   refline 0.7775  / axis=y label="Plateau"    labelpos=min;&lt;BR /&gt;   refline 12.7477 / axis=x label="Join point" labelpos=min;&lt;BR /&gt;   scatter y=y  x=x;&lt;BR /&gt;   series  y=yp x=x;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[image: image.png]</description>
      <pubDate>Wed, 12 Aug 2020 18:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676274#M203900</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2020-08-12T18:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676275#M203901</link>
      <description>&lt;P&gt;Its possible that you don't have the required license.&lt;/P&gt;
&lt;P&gt;Check the the following link to see how to check that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/16/955.html" target="_blank" rel="noopener"&gt;https://support.sas.com/kb/16/955.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 18:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676275#M203901</guid>
      <dc:creator>Angel_Larrion</dc:creator>
      <dc:date>2020-08-12T18:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676278#M203902</link>
      <description>I use SAS Edition.&lt;BR /&gt;May you be able to test for me, please.&lt;BR /&gt;I want to see a graph of the predict number 25%, 50% and 75% increase.&lt;BR /&gt;It is for my thesis work. If it works well I will use my real dataset.&lt;BR /&gt;&lt;BR /&gt;Phan S.&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Aug 2020 19:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676278#M203902</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2020-08-12T19:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676283#M203904</link>
      <description>&lt;P&gt;I don´t have that product.&lt;/P&gt;
&lt;P&gt;you could try making another post, maybe someone else can help you with that.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2020 19:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676283#M203904</guid>
      <dc:creator>Angel_Larrion</dc:creator>
      <dc:date>2020-08-12T19:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Predictive numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676284#M203905</link>
      <description>Ok, Thank you.&lt;BR /&gt;&lt;BR /&gt;Phan S.&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Aug 2020 19:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Predictive-numbers/m-p/676284#M203905</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2020-08-12T19:37:12Z</dc:date>
    </item>
  </channel>
</rss>

