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

st: RE: Wish: highlight cells in browse


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Wish: highlight cells in browse
Date   Tue, 1 Oct 2002 18:39:42 +0100

Renzo Comolli
 
> I am first time poster and hope I am doing this right.
> Anyway, I have seen some people post their wish for version 
> 8 here are
> mine:
> 
> 1) browse if... , highlighting if ...
> This command would allow you to browse the entire dataset (or a
> restriction) and highlight some cells specified by the 
> condition (using
> colors, as in Excel)
> 
> 2) drop x if inlist(x,1,25,.)
> This command would allow you to drop a column if that 
> column contains
> only the values specified in the condition
> 

The existing syntax of -drop- includes 

. drop <varname> 

and 

. drop if <exp> 

Renzo wants a hybrid whereby 

. drop <varname> if <exp> 

drops <varname> if _all_ of its values 
satisfy <exp>. This would be totally 
non-standard syntax: as such, my guess is that 
you will never get Stata Corp to 
buy this; in fact, I doubt that this 
could be programmed without breaking 
Stata. 

In any case, I vote against it. 

The reason is that any command 
with an -if- condition results 
in an observation by observation 
test, whereas Renzo wants a test 
of all the observations simultaneously, 
which in effect would change the meaning
of -if-. 

More positively, you can get 
this behaviour for yourself 
by some code, something like this 

program def dropifall 
	version 7 
	syntax varlist [if] 
	qui count `if' 
	if r(N) == _N { 
		drop `varlist' 
	} 
end 

provided that the syntax, 
which is standard, is understood
to have its own special result. 

Nick 
[email protected] 


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