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" <[email protected]>
To   <[email protected]>
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:[email protected]] 
	Sent: Mon 08/02/2004 13:08 
	To: [email protected] 
	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
	[email protected]
	
	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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index