# Wilcox’s Robust Statistics: A new R package

April 12, 2011 Filed in: R

[Update Aug 2013: For a fail safe installation routine, see this up-to-date post: Installation of the WRS package]

Recently I started to build a new package for R containing Wilcoxâ€™ collection of functions for robust statistics.

Wilcox provides 700+ functions for robust statistics, including:

- robust correlations (e.g. percentage bend correlation)
- robust measures of location and mean differences (e.g. Yuenâ€™s test, trimmed mean test with bootstrapping)
- bootstrapping routines for many indices. Using bootstrapping, asymmetric and non-parametric confidence intervals can be calculated
- Â etc …

Iâ€™ve simply put Wilcoxâ€™ functions into a package, so that the environment isnâ€™t cluttered with 700+ functions. I also started to add some help functions (but until now there are really few).

The package is hosted on R-Forge. You can install the package directly in R by typing:

install.packages("WRS", repos="http://R-Forge.R-project.org")

Thank you for your work Felix!

Could you let me know if you were using the 2nd or 3rd edition of Wilcox’ book?

I have just recently started using the script, but found the TBS and RMBA estimators not to work in the out function.

Anyways, thank you for your effort!

Kind Regards,

Conrad

Hi Conrad, these functions are constantly updated by Rand Wilcox, so they do not fit to a specific edition of his books. If you think you found an error you could send me a reproducible example and I’ll try to fix the bug …

The package has been updated to version 0.20 yesterday (see here), so maybe they work now?

Cheers, Felix

Hi Felix,

All the best for the new year!

I see that all the estimators listed in the out help file are now working with the latest release, except for the TBS estimator (cov.roc)

The way I am using the command is as follows:

> library(WRS)

Loading required package: MASS

Loading required package: akima

Loading required package: robustbase

Attaching package: ‘WRS’

The following object(s) are masked from ‘package:robustbase':

hard.rejection

The following object(s) are masked from ‘package:stats':

ecdf

The following object(s) are masked from ‘package:grDevices':

bmp

> out(SOC.listwise, cov.fun = cov.roc, plotit= T)

Error in out(SOC.listwise, cov.fun = cov.roc, plotit = T) :

object ‘cov.roc’ not found

Kind Regards,

Conrad

Hi Conrad,

indeed that seems to be a bug. cov.roc works for unidimensional vectors, but not for matrices. I submitted the bug to Wilcox, I’m sure he will take care about it soon! I will write in this thread when it’s fixed.

Here’s a reproducible example: y works, x not:

x <- matrix(c(rnorm(100), 3, 3.6, 7, 4), ncol=2)

library(WRS)

out(x, cov.fun=cov.mve, plotit=TRUE)

out(x, cov.fun=cov.mcd, plotit=TRUE)

out(x, cov.fun=covmba2, plotit=TRUE)

out(x, cov.fun=rmba, plotit=TRUE)

out(x, cov.fun=cov.roc, plotit=TRUE)

Cheers,

Felix

Hi, Rand Wilcox fixed the bug – should work now!

WRS package is updated on R-Forge, the binary should be available tomorrow.

Felix

Hi Felix,

Thank you for your feedback. I can confirm that it works now on my side as well ðŸ˜‰

Please convey my thanks to Rand as well.

Kind Regards,

Conrad Zygmont

Dear Felix!

When I try to install the package WRS using following command:

—————————————————————

install.packages(“WRS”, repos=”http://R-Forge.R-project.org”)

—————————————————————

I get following message:

—————————————————————

Installing package into â€˜C:/Users/Iris/Documents/R/win-library/3.0â€™

(as â€˜libâ€™ is unspecified)

package â€˜WRSâ€™ is available as a source package but not as a binary

Warning message:

package â€˜WRSâ€™ is not available (for R version 3.0.0)

—————————————————————-

Would I need to use a different version of R to run the package?

Thank you and kind regards,

Iris

Hi Iris,

I uploaded a fixed version to R-Forge; by tomorrow it should work (when the next built cycle has run).

Could you give me a short note if it works on your machine?

Meanwhile, you could also try install.packages(“WRS”, repos=”http://R-Forge.R-project.org”, type=”source”). This might work. Or you wait until tomorrow.

F

If you still have troubles installing WRS: I posted an installation procedure that should be fail-safe

Dear Felix,

I have the same problem as Iris on the 10th of April had (WRS package not available for R 3.0.1). I’ve had this problem three days in a row… I have installed all three required packages without trouble.

Can you help me?

Kind regards

Ben

Hi, have you tried the fail-safe installation procedure: http://www.nicebread.de/installation-of-wrs-package-wilcox-robust-statistics/ ?