Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: How to find extreme values

From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: How to find extreme values
Date   Tue, 27 Mar 2012 09:27:07 +0200

On Tue, Mar 27, 2012 at 5:24 AM, Barth Riley <[email protected]> wrote:
> To remove outliers, you could:
> preserve
> replace var = . if abs(var) >= 1000000 (or some other value)
> [perform analyses]
> restore
> preserve and restore are added if you want to make a temporary change to
> these values

If I were to exclude such observations I would probably do something like:

gen byte touse = abs(var) <= 1e6
reg y var x if touse

-reg- could be any command, the key is the -if touse- part. The
variable touse will contain 0s and 1s such that those non-extreme
values get 1 (true) and the extreme values get 0 (false), see:
<>. The reason
why I prefer this is that it does not destroy any information in my

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index