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

RE: st: Winsor by group - still can't get it


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Winsor by group - still can't get it
Date   Mon, 2 Aug 2004 18:08:40 +0100

This code is legal and works: 

. gen winsor = . 
(1031 missing values generated)

. forval y = 1976/1984 { 
  2. winsor emp if year == `y', h(1) gen(temp) 
  3. replace winsor = temp if year == `y' 
  4. drop temp
  5. }

I can't comment usefully on what you're doing 
wrong without seeing what you typed. 

FAQ: "Say exactly what you typed and exactly what 
Stata typed (or did) in response. N.B. exactly!"  

Nick 
n.j.cox@durham.ac.uk 

Kiousis, P. Konstantina
 
> Sorry but I still can't get this to work.  I tried using a 
> stata dataset as a test.  I used 
> 
> use http://fmwww.bc.edu/ec-p/data/macro/abdata.dta
> 
> After the forval, I get an error message 0 values to be 
> winsorized.  I tried creating a local variable for max and 
> min year and a few other things but for some reason, it still 
> isn't working.  What would the syntax be for this dataset?  

*
*   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