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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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