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" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
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 
n.j.cox@durham.ac.uk 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index