The reason for this is that winsorize
in robustHD
uses solve
. If you look deeper into the code, winsorize
on a data frame calls the winsorize.data.frame
method, which is simply a script that runs as.matrix
and then uses the winsorize.matrix
method. This in turns does a bunch of things, but the problem here is that it uses the solve
function.
The error you get is from solve
. The error probably occurs because you included some variables/columns that are very highly correlated, or rather, they are linear combinations of each other. You may want to check if you have duplicated variables or variables that are transformations of each other.
There are several things you can do:
- Remove one of the highly correlated variables and try again.
- Check out a different package to use
winsorize
from.
- Write your own winsorize function.
The quickest way to do the second step:
require(sos)
findFn("winsorize")
This will produce an overview of all functions that have the word "winsorize" in their description. Just look for functions that are described to be used for winsorization.