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

RE: st: Winsor by group - Thanks


From   "Kiousis, P. Konstantina" <kiousis_1@cob.osu.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Winsor by group - Thanks
Date   Mon, 2 Aug 2004 13:21:38 -0400

	su year, meanonly

	qui forval y = 1976/1984 {

	winsor emp if year == `y', h(1) gen(temp)

	replace winsor = temp if year == `y'

	drop temp

	}

	 
	-----Original Message----- 
	From: Nick Cox [mailto:n.j.cox@durham.ac.uk] 
	Sent: Mon 08/02/2004 13:08 
	To: statalist@hsphsun2.harvard.edu 
	Cc: 
	Subject: RE: st: Winsor by group - still can't get it
	
	

	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/
	


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