Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Winsor by group


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Winsor by group
Date   Mon, 2 Aug 2004 16:39:20 +0100

-winsor- doesn't support a -by()- option or -by:-. 

Your options include rewriting it so that it does, 

or 

(say) 

gen winsor = . 
su year, meanonly 
qui forval y = `r(min)'/`r(max)' { 
	winsor response if year == `y', <winsor_options> gen(temp) 
	replace winsor = temp if year == `y' 
	drop temp 
} 
	
Nick 
n.j.cox@durham.ac.uk 

Neil Shephard replied to KK 

> > I am working with a time series and interested in winsorizing a
> > variable by year.  What is the easiest way to do this?  Thanks, KK
> > 
> 
> .findit winsor
> 
> suggests that you might want to try installing and using the 
> -winsor- command.
> 
> DESCRIPTION/AUTHOR(S)
>       
>       winsor takes the non-missing values of a variable and 
> generates a
>       new variable  identical except that the h highest and h lowest
>       values are replaced by the  next value counting inwards from the
>       extremes. h can be specified directly or  indirectly by
>       specifying a fraction p of the number of observations: h =  [p
>       n]. This transformation is named after the biostatistician C.P.
>       Winsor. This is version 1.3.0 of  the software.
>       

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index