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

st: RE: display and stata commands


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: display and stata commands
Date   Tue, 25 Feb 2003 11:48:16 -0000

Arngrim Hunnes
> 
> The following code works just fine:
> 
> foreach var of local vlist{;
>         display as text "`var'";
> 	count if `var' >= .;
> };
> 
> My problem is that I want to display all this on one line.  
> But if I use
> 
> 	display as text "`var'" count if `var' > = .;
> 
> it does not work!
> 
> So my question is: how to I force Stata do display my 
> information on one
> line?

One solution in this case: 

foreach var of local vlist {
 	count if `var' >= .
      display as text "`var' " `r(N)' 
}

Also check out the _c feature of -display-. 

This code looks like a special case of -nmissing- 
(STB-49, STB-60). 

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