UCLA Academic Technology Services HomeServicesClassesContactJobs
Help the Stat Consulting Group by giving a gift             
Loading

Stata FAQ
How do you use the wincorr command?

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 http://www.ats.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 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 findit wincorr and you can obtain winsor by typing findit winsor (see How can I use the findit command to search for programs and get additional help? for more information about using findit). Note: the wincorr command requires winsor.ado by N. Cox.
Reference
Wilcox, R. (2001) Fundamentals of modern statistical methods. New York: Springer.

How to cite this page

Report an error on this page or leave a comment

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.