Statalist The Stata Listserver


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

st: Invalid Syntax - Drop


From   Socrates Mokkas <[email protected]>
To   [email protected]
Subject   st: Invalid Syntax - Drop
Date   Sun, 29 Oct 2006 12:11:45 +0000

Hello All, 

I have a problem with dropping variables. This is my small loop:

foreach var of varlist cross* {
	qui su `var'
	drop `var' if `r(max)'==0
}

Why is the invalid syntax comming up? What I want to do is to drop variables ( included in the varlist cross*) if they have values only of zeros or missing values. Am I missing the obvious here?

Thanks a lot!

Regards, 
Socrates
*
*   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