BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
user24feb
Barite | Level 11

I'd like to try some of the examples in "simulation models for business planning and economic forecasting" ( https://support.sas.com/rnd/app/ets/papers/simulationmodels.pdf ). Does anybody know where to find the sales-toaster-data?

1 ACCEPTED SOLUTION

Accepted Solutions
ShelleySessoms
Community Manager

Hi @user24feb, I contacted the author of the paper and was told it's fake data. But he did provide the code. Hope it helps.

 

Thanks,

Shelley

 

data toast;
    tsales =870;
    fs_sales =470;
    fs_price =10;
    gnp = 0.5;
    price = 10.1;
    do t=1 to 50;
       month = t;
       price = price * 0.8 + 1.5 * rannor(52) + 1.5;
       fs_price = 0.7 * fs_price + 15.1 + 5 * rannor(5);
       bprice = 0.1 + 0.01 * rannor(2);
       gnp =  0.8 * gnp  + 0.7 *rannor(156) + 1;
       nwed = 4 * sin(t/5) + 25 + 3*rannor(644);
       tsales = 0.91 *tsales - 18.5 * price ** 1.2 +
             13 *nwed + 10 * gnp + 30;
       fs_sales = 0.9 * fs_sales - fs_price ** 0.5 +
             18 * gnp + 50 ;
       if t >= 15 and t < 20 then tsales = tsales + 250;
       if t >= 35 and t < 40 then tsales = tsales + 290;

       if t >= 15 and t < 20 then fs_sales = fs_sales + 150;
       if t >= 35 and t < 40 then fs_sales = fs_sales + 190;

       ad_cost =0;
       if t >= 15 and t < 20 then ad_cost = 5000;
       if t >= 35 and t < 40 then ad_cost = 8000;

       tsales = (tsales - 0.01 * fs_sales) /0.9995;
       fs_sales = fs_sales - 0.015 * tsales;
       tsales = tsales + 20*rannor(7);
       fs_sales = fs_sales + 8*rannor(66);

       output;
    end;
run;


title height=4 'Monthly Toaster Sales';
proc gplot data=toast;
   axis1  value=(height=3) label=(height=3  'Months');
   axis2 value=(height=3) label=(height=3  'TSales');
   plot tsales*month / haxis=axis1 vaxis=axis2;
   symbol1 width=2 i=join ;
run;

View solution in original post

2 REPLIES 2
ShelleySessoms
Community Manager

Hi @user24feb, I contacted the author of the paper and was told it's fake data. But he did provide the code. Hope it helps.

 

Thanks,

Shelley

 

data toast;
    tsales =870;
    fs_sales =470;
    fs_price =10;
    gnp = 0.5;
    price = 10.1;
    do t=1 to 50;
       month = t;
       price = price * 0.8 + 1.5 * rannor(52) + 1.5;
       fs_price = 0.7 * fs_price + 15.1 + 5 * rannor(5);
       bprice = 0.1 + 0.01 * rannor(2);
       gnp =  0.8 * gnp  + 0.7 *rannor(156) + 1;
       nwed = 4 * sin(t/5) + 25 + 3*rannor(644);
       tsales = 0.91 *tsales - 18.5 * price ** 1.2 +
             13 *nwed + 10 * gnp + 30;
       fs_sales = 0.9 * fs_sales - fs_price ** 0.5 +
             18 * gnp + 50 ;
       if t >= 15 and t < 20 then tsales = tsales + 250;
       if t >= 35 and t < 40 then tsales = tsales + 290;

       if t >= 15 and t < 20 then fs_sales = fs_sales + 150;
       if t >= 35 and t < 40 then fs_sales = fs_sales + 190;

       ad_cost =0;
       if t >= 15 and t < 20 then ad_cost = 5000;
       if t >= 35 and t < 40 then ad_cost = 8000;

       tsales = (tsales - 0.01 * fs_sales) /0.9995;
       fs_sales = fs_sales - 0.015 * tsales;
       tsales = tsales + 20*rannor(7);
       fs_sales = fs_sales + 8*rannor(66);

       output;
    end;
run;


title height=4 'Monthly Toaster Sales';
proc gplot data=toast;
   axis1  value=(height=3) label=(height=3  'Months');
   axis2 value=(height=3) label=(height=3  'TSales');
   plot tsales*month / haxis=axis1 vaxis=axis2;
   symbol1 width=2 i=join ;
run;
user24feb
Barite | Level 11
If somebody else is ever interested: Add `date = intnx('month', '01JAN89'd, t); format date Date9.;`.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 648 views
  • 4 likes
  • 2 in conversation