12
$\begingroup$

For part of a homework question, I was asked to calculate the trimmed mean for a dataset by deleting the smallest and largest observation, and to interpret the result. The trimmed mean was lower than the untrimmed mean.

My interpretation was that this was because the underlying distribution was positively skewed, so the left tail is denser than the right tail. As a result of this skewness, removing a high datum drags the mean down more than removing a low one pushes it up, because, informally speaking, there are more low data "waiting to take its place." (Is this reasonable?)

Then I began to wonder how the trimming percentage affects this, so I calculated the trimmed mean $\bar x_{\operatorname{tr}(k)}$ for various $k = 1/n, 2/n, \dotsc, (\frac{n}{2}-1)/n$. I got an interesting parabolic shape: Plot of trimming percentage vs. trimmed mean; forms a concave-up curve that looks roughly parabolic

I'm not quite sure how to interpret this. Intuitively, it seems like the slope of the graph should be (proportional to) the negative skewness of the portion of the distribution within $k$ data points of the median. (This hypothesis does check out with my data, but I only have $n = 11$, so I'm not very confident.)

Does this type of graph have a name, or is it commonly used? What information can we glean from this graph? Is there a standard interpretation?


For reference, the data are: 4, 5, 5, 6, 11, 17, 18, 23, 33, 35, 80.

$\endgroup$

3 Answers 3

11
$\begingroup$

@gung and @kjetil b. halvorsen are both correct.

I have found such graphs in

Rosenberger, J.L. and M. Gasko. 1983. Comparing location estimators: Trimmed means, medians, and trimean. In Understanding Robust and Exploratory Data Analysis, Eds. D.C. Hoaglin, F. Mosteller, and J.W. Tukey, 297–338. New York: Wiley.

and

Davison, A.C. and D.V. Hinkley. 1997. Bootstrap Methods and Their Application. Cambridge: Cambridge University Press.

and give further examples in

Cox, N.J. 2013. Trimming to taste. Stata Journal 13: 640–666. http://www.stata-journal.com/article.html?article=st0313 [free access to pdf]

which discussed many aspects of trimmed means.

As far as I know, the graph does not have a distinct name. A distinct name for every possible plot would actually be a small nightmare: graphical terminology is already a horrible mess. I would just call it a plot of trimmed mean versus trimmed number, fraction or percent (thus reversing the OP's wording).

For further small comments on "versus", see my answer in Heteroscedasticity in Regression

EDIT: For yet more on versus (language mavens only), see here.

$\endgroup$
10
$\begingroup$

I've never heard of this graph, but I think it's pretty neat; probably someone has done this before. What you can do with it is see how the mean shifts and/or stabilizes if you consider differing proportions of your data to be outliers. The reason that you get the parabolic shape is that your (initial) distribution is right skewed as a whole, but the degree of skew is not the same in the center of the distribution. For comparison, consider the kernel density plots below.

enter image description here

On the left are your data as they are trimmed one by one. On the right are these data: y = c(5.016528, 7.601235, 10.188326, 13.000723, 16.204741, 20.000000, 24.684133, 30.767520, 39.260622, 52.623029, 79.736416), which are quantiles of a standard lognormal distribution taken from equally spaced percentiles and multiplied by 20 to make the range of values similar.

Your data start right skewed, but by row 5, they are left skewed, so trimming more data starts to bring the mean back up. The data on the right maintain a similar skew as the trimming continues.

Below are your plot for the lognormal data and uniform data (z = 1:11, no skew--perfectly symmetrical).

enter image description here enter image description here

$\endgroup$
4
$\begingroup$

I don't think this kind of graph has a name, but what you are doing is reasonable, and your interpretation, I think, valid. I think what you are doing is related to Hampel's Influence function, see https://en.wikipedia.org/wiki/Robust_statistics#Empirical_influence_function especially the section about the empirical influence function. And your plot could certainly be related to some measure of skewness of the data, since, if your data were perfectly symmetrical, the plot would be flat. You should investigate that!

            EDIT     

One extension of this plot is to show also the effect of using different trimming at left and right. Since this is not implemented in the usual mean function with argument trim in R, I wrote my own trimmed mean function. To get a smoother plot I use linear interpolation when the trimming fraction implies removing a non-integer number of points. This gives the function:

my.trmean  <-  function(x, trim)  {
    x  <-  sort(x)
    if (length(trim)==1) {
        tr1  <-  tr2  <-  trim }  else {
                                   tr1  <-  trim[1]
                                   tr2  <-  trim[2] }
    stopifnot((0 <= tr1)&& (tr1 <= 0.5)); stopifnot(
               (0 <= tr2)&&(tr2 <= 0.5))
    n  <-  length(x)
    if ((tr1>=0.5-1/n)&&(tr2>=0.5-1/n)) return( median(x) )

    k1  <-  floor(n*tr1) ; k2  <-  floor(n*tr2)
    a1  <-  n*tr1-k1     ; a2  <-  n*tr2-k2
    crange  <-  if ( (k1+2) <= (n-k2-1) ) ((k1+2):(n-k2-1)) else 
                       NULL
    trmean  <-  sum(c((1-a1)*x[k1+1], x[crange], 
                    (1-a2)*x[n-k2]))/(length(crange)+2-(a1+a2)  )
    trmean     
}

Then I simulate some data and shows the result as a contour plot:

tr1  <-  seq(0, 0.5, length.out=25)
tr2  <-   seq(0, 0.5, length.out=25)

x  <-  rgamma(10000, 1.5)
vals  <-  outer(tr1, tr2, FUN=Vectorize(function(t1, t2) 
                 my.trmean(x, c(t1, t2))))

image(tr1, tr2, vals, xlab="left trimming", 
        ylab="right trimming", main="Effect of trimming")
contour(tr1, tr2, vals, nlevels=20, add=TRUE)

giving this result:

contour plot showing effect of trimming

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.