Hi everyone, does anyone know how to calculate mean error(ME) in SAS. I checked the proc means, its statistical list does not contain ME. So I'm wondering are there any procedures that can calculate ME directly? Thanks for any hints.
In a data step, compute the value of y minus y-hat. Then in PROC MEANS or PROC SUMMARY, compute the mean of this difference.
If that's not what you are looking for, then a few more details would help. What is meant in the formula by y-hat? Does it have to do with predicting (the word "prediction" appears) from a model? If so, what type of model (and what SAS PROC) creates this model? What are the variable names in your SAS data set?
If y sub i is an individual value and the y hat is the predicted then you are looking at residuals and that looks like the mean of residuals. If so, then you run a regression and get the residuals in the output. Then take the mean of the residual.
@ballardw wrote:
If y sub i is an individual value and the y hat is the predicted then you are looking at residuals and that looks like the mean of residuals. If so, then you run a regression and get the residuals in the output. Then take the mean of the residual.
Which is zero for many types of models. No need to compute it (if this comes from one of those types of models)
@PaigeMiller wrote:
@ballardw wrote:
If y sub i is an individual value and the y hat is the predicted then you are looking at residuals and that looks like the mean of residuals. If so, then you run a regression and get the residuals in the output. Then take the mean of the residual.
Which is zero for many types of models. No need to compute it (if this comes from one of those types of models)
Yep. Which is partially why I was asking what the y values in the formula represent.
For the Mean error you need an observed/recorded value minus the predicted value, which comes from a model.
If you only have a single value, the typical estimate ends up being the mean, so then your formula changes to
1/n*sum(observed - mean(x))
which has a value of 0 always. I'll leave the algebra as an exercise for you, or for you to google at least 😉
Unless you have a modeled value, this is a 'trick' question. This is why the mean squared error or the mean absolute error measures are used instead.
@Cecillia_Mao wrote:
Hi everyone, does anyone know how to calculate mean error(ME) in SAS. I checked the proc means, its statistical list does not contain ME. So I'm wondering are there any procedures that can calculate ME directly? Thanks for any hints.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.