probability or statistics - Winsorizing in Mathematica and the R package DescTools yields differing results
I am currently trying to winsorize several datasets up to 1000 datapoints in R and in Mathematica for using those in regression estimations afterwards. Following the suggestion in the question http://mathematica.stackexchange.com/questions/152936/list-with-inadequate-structure-in-the-output-of-a-defined-function, I used
Clip[grate16, Quantile[grate16, {.05, .95}]]
to winsorize my data in Mathematica. Yet, if I use the Winsorize
function from the package 'DescTools' in R with the code
Winsorize(grate16, probs = c(0.05, 0.95))
for exactly the same datasets, the results differ for some observations from about the 3 decimal-digit level which leads to heavily differing end results. Cursory documentation for this function can be found here. The code (in GitHub) for this function can be found here.
Since the deviations are so large for the same datasets, I do not think this is a numerical accuracy issue. I tried differing levels of precision and accuracy in Mathematica which, however, did not improve the situation. What am I missing?
Comments
Post a Comment