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

st: Deleting variables for lack of observations

From   "Joel Clovis" <>
Subject   st: Deleting variables for lack of observations
Date   Wed, 26 Feb 2003 18:14:08 +0000

Dear listers,

I want to delete variables if they do not contain enough observatoins.  I've
tried to make use of Nick Coxs'  npresent & dropmiss (STB-49:dm67 &
STB-60: dm89)  to no avail, some attempts are in the following manner:

foreach var of varlist cba2tfina-region {
            keep `var' if r(npresent)>=30

this brings up invalid syntax, and I'm not sure why and

keep if npresent(lifeinsdensity )<30

results in 0 observations being deleted, even though
npresent(lifeinsdensity ) without keep..returns  lifeinsdensity  10

Can anyone help?  I'm a Stata 7 user

Kind regards

Joel Clovis
*   For searches and help try:

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