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

Re: st: Dropping the largest and smallest 1% of observations


From   Antoine Terracol <[email protected]>
To   [email protected]
Subject   Re: st: Dropping the largest and smallest 1% of observations
Date   Thu, 13 Feb 2003 09:05:04 +0100

Hello,
use the results saved after -summarize, detail-

summarize varname, detail
drop if varname<r(p1) | varname>r(p99)


If you have many variables, use -tokenize-

tokenize "varname1 varname2 varname3 ..."
while "`1'"!="" {
		qui summarize `1', detail
		drop if `1'<r(p1) | `1'>r(p99)
		macro shift
		}

Hope this helps,
Antoine.
	

FUKUGAWA, Nobuya wrote:
I want to cut off extraordinarily large and small values from variables
used in regression analysis. What is the easiest way to drop the largest and smallest 1% of observations
from variables in STATA-7?
Thanks in advance.




--
Ce message a subi une analyse antivirus par MailScanner ; il est vraisemblablement
sans danger.

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