Hi,
I was wondering whether you had any tips on how to calculate a trimmed mean... I have a matrix of forecasting results from different models, and rather than to average them across models, I would like to calculate trimmed means - that is, exclude the highest and lowest observation and average over the rest.
I can think of a couple of complicated ways to do this, but maybe someone has a really easy solution...? :-)
Thanks, Philipp
Trimmed mean
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: Trimmed mean
Something like the following might work for calculating the trimmed means:
Code: Select all
vector trmean = (@rows(ymat)*@cmean(ymat)-(@cmin(ymat)+@cmax(ymat)))/(@rows(ymat)-2)-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Trimmed mean
or,
Or for more general trimming, use the Trim Add-in.
Code: Select all
smpl @first+1 @last-1
scalar mean = @mean(x)
Re: Trimmed mean
Solution 1 works perfectly!
Thanks, Philipp
Thanks, Philipp
Who is online
Users browsing this forum: No registered users and 1 guest
