[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: How to drop some Observation in Stata, if they are out ofrange?

From   Neil Shephard <[email protected]>
To   [email protected]
Subject   Re: st: How to drop some Observation in Stata, if they are out ofrange?
Date   Tue, 23 Sep 2008 09:34:11 +0100

bumbuminc wrote:
Hi, there
I want to drop some Observations in Stata, who are out of a certain range.
For example: I have 2 variables, the first one is an identnumber and
the second one are the earnings.
Now I want Stata to drop all the Observation who are under a minimum
earning and all who are over a maximum earning and save this under a
new variable.
 In the moment i can't figure it out by myself.
Hopefully someone can help me.
An example using the auto dataset...

sysuse auto
gen restrictedprice = price if(price >4000 & price < 11000)


This  message  may  contain  confidential and  privileged  information.
If you  are not the  intended recipient  you should not  disclose, copy
or distribute information in this e-mail or take any action in reliance
on its contents.  To do so is strictly  prohibited and may be unlawful.
Please  inform  the  sender that  this  message has  gone astray before
deleting it.  Thank you.

2008 marks the 60th anniversary of the NHS.  It's an opportunity to pay
tribute to the NHS staff and volunteers who help shape the service, and
celebrate their achievements.

If you work for the NHS  and  would like  an NHSmail  email account, go

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index