The wincorr command is designed for situations in which a few observations
appear to be distorting the correlation between two variables. Consider the following scatter
plot and correlation:
use https://stats.idre.ucla.edu/stat/stata/faq/wincor, clear scatter a bcorr a b (obs=22) | a b -------------+------------------ a | 1.0000 b | -0.6027 1.0000
It is clear that the majority of points have a strong positive relationship, however because
of a few extreme points the Pearson correlation is negative.
If we were to winsorize each of the variables and correlate them the influence of the extreme
points would be reduced.
wincorr a b winsorized correlation r_w(a, b) = 0.6900 N = 22 approximate t = 4.26 df = 12 p-value = 0.0011
The winsorized correlation is 0.69 which is closer to the actual relationship.
You can download wincorr by typing search wincorr and you can
obtain winsor by typing search winsor (see
How can I use the search command to search for programs and get additional
help? for more information about using search). Note: the wincorr command requires winsor.ado
by N. Cox.
Reference
Wilcox, R. (2001) Fundamentals of modern statistical methods. New York: Springer.
corr a b
(obs=22)
| a b
-------------+------------------
a | 1.0000
b | -0.6027 1.0000