turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Data Mining
- /
- How Mean Absolute Percentage Error %28MAPE%29 can ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-27-2015 08:44 AM

We ran linear regression on our dataset. We expect the regression node to output actual as wells as predicted values.

Now we want to calculate MAPE i.e. (actual-predicted)/actual.

Is there any options in SAS miner that would give this value?

Accepted Solutions

Solution

4 weeks ago

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-01-2015 09:28 AM

You would have to calculate this in a SAS Code node. If you connect your Regression node to a SAS Code node, then in the SAS Code node, the data set represented by the &em_import_data macro variable contains your actual and predicted target for each obervation. So you could do something like:

```
data calc_mape;
set &em_import_data;
mape = %EM_RESIDUAL / %EM_Target;
run;
proc means data=calc_mape sum;
var mape;
run;
```

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-30-2015 01:32 PM

Hello,

mean absolute error (MAE) and mean absolute percentage error (MAPE) are not a part of standard regression output.

They are more commonly found in the output of time series forecasting (time series regression) procedures, such as the ones in SAS/ETS, SAS/HPF (Forecast Server).

MAPE is easy to compute of course but beware that the MAPE can only be computed with respect to data that are guaranteed to be strictly positive.

I bumped into this paper (but cannot give any guarantee about its quality):

Using the Mean Absolute Percentage Error for Regression Models (Arnaud de Myttenaere: first author).

https://www.elen.ucl.ac.be/Proceedings/esann/esannpdf/es2015-107.pdf

https://hal.archives-ouvertes.fr/hal-01162980/document

Koen

Solution

4 weeks ago

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-01-2015 09:28 AM

You would have to calculate this in a SAS Code node. If you connect your Regression node to a SAS Code node, then in the SAS Code node, the data set represented by the &em_import_data macro variable contains your actual and predicted target for each obervation. So you could do something like:

```
data calc_mape;
set &em_import_data;
mape = %EM_RESIDUAL / %EM_Target;
run;
proc means data=calc_mape sum;
var mape;
run;
```