Robust location measures and their standard errors (se).

Share:

Description

The following functions for estimating robust location measures and their standard errors are provided: winmean for the Winsorized mean, winse for its se, trimse for the trimmend mean se, msmedse for the median se, mest for the M-estimator with se in mestse.

Usage

1
2
3
4
5
6
winmean(x, tr = 0.2, na.rm = FALSE)
winse(x, tr = 0.2)
trimse(x, tr = 0.2, na.rm = FALSE)
msmedse(x, sewarn = TRUE)
mest(x, bend = 1.28, na.rm = FALSE)
mestse(x, bend = 1.28)

Arguments

x

a numeric vector containing the values whose measure is to be computed.

tr

trim lor Winsorizing level.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

sewarn

a logical value indicating whether warnings for ties should be printed.

bend

bending constant for M-estimator.

Details

The standard error for the median is computed according to McKean and Shrader (1984).

References

Wilcox, R. (2012). Introduction to Robust Estimation and Hypothesis Testing (3rd ed.). Elsevier.

McKean, J. W., & Schrader, R. M. (1984). A comparison of methods for studentizing the sample median. Communications in Statistics - Simulation and Computation, 13, 751-773.

Dana, E. (1990). Salience of the self and salience of standards: Attempts to match self to standard. Unpublished PhD thesis, Department of Psychology, University of Southern California.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Self-awareness data (Dana, 1990): Time persons could keep a portion of an 
## apparatus in contact with a specified range.
self <- c(77, 87, 88, 114, 151, 210, 219, 246, 253, 262, 296, 299, 306, 376, 
          428, 515, 666, 1310, 2611)
mean(self, 0.1)     ## .10 trimmed mean 
trimse(self, 0.1)   ## se trimmed mean
winmean(self, 0.1)  ## Winsorized mean (.10 Winsorizing amount)
winse(self, 0.1)    ## se Winsorized mean
median(self)        ## median
msmedse(self)       ## se median
mest(self)          ## Huber M-estimator
mestse(self) 

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.