BookmarkSubscribeRSS Feed
grezek
Obsidian | Level 7

I'm looking for an acceptable way for adjusting a series using another series.  In my case I have paired values of actual and forecast data from which I can calculate MAPE.  I would like to adjust MAPE to take fluctuations in underlying values, let's say fluctuations in actual, into account, such that periods of high values for actual would have more influence than periods of low values for actual over MAPE.  I keep thinking that there's some standard procedure for this, but can't seem to find anything online.

 

Any suggestions will be appreciated.  Thank you.  -- George

3 REPLIES 3
Rick_SAS
SAS Super FREQ

You might be thinking of the method of reweighted residuals. This is a technique that was a precursor to modern robust regression techniques, and it serves as the basis for the robust technique known as M Estimation.

 

You might want to use PROC ROBUISTREG to carry out this method. You can use the OUTPUT statement with WEIGHT=MyWtVar to create an output data set that contains the final weights. 

 

grezek
Obsidian | Level 7
Rick_SAS: This sounds very promising; I'll try it today and get back to you. Thank you very much!
grezek
Obsidian | Level 7

I ran the following code

proc robustreg data = sasdb.back2 method = m;
  model perc_var = actual ;
  weight = actual ;
  output out=sasdb.myweightds weight = myweight ;
run ;

 

From the output the blue line is the actual; the brown the forecast from which the MAPE is calculated. Here we see the percent error in red (scale on right side).  Given the differences in exposure levels I wanted to dampen the MAPE in area where the actual was far from the average.  We see the weights in green (scale on right side).  What I want is a weight to adjust the red line by actual such that in the earlier periods of adjusted MAPE would appear above the red line;  in the final periods I would expect the adjusted line to appear below the red line.

 

It's obvious that I'm not familiar with how to use the weights, even if I'm getting what I need.  Please tell me that I'm on the right track and indicate where I would look for an explanation of how to use what I have here (or tell me that I'm doing not right). 

 

Thanks for your help.  -- George 

 

M.png

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 643 views
  • 0 likes
  • 2 in conversation