The

wincorrcommand 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 b corr 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 bwinsorized 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

wincorrby typingsearch wincorrand you can obtainwinsorby typingsearch winsor(see How can I use the search command to search for programs and get additional help? for more information about usingsearch). Note: thewincorrcommand requireswinsor.adoby N. Cox.

Reference

Wilcox, R. (2001)Fundamentals of modern statistical methods.New York: Springer.