Statalist The Stata Listserver


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

st: RE: Outputting formatted data to file


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Outputting formatted data to file
Date   Mon, 9 Oct 2006 10:49:53 +0100

I can't see what the problem is here. -macval()- 
is mentioned, but admittedly not explained, in 
the help for -macro-, from which the trail
leads directly to [P] macro. But I don't sense that 
it is relevant to your project as glimpsed here. 
-macval()- inhibits expansion of macros; it is 
useful when you want to echo typed commands 
exactly, but hardly otherwise. 

I have never had to try binary output to get
formatting. On the face of it formatting leads
to syntax like that here. Why do you call it extremely 
unaesthetic? 

Nick 
n.j.cox@durham.ac.uk 

Steffen Hokland
 
> I'm trying to output some results to a file in formatted style.
> 
> However, it seems the only way to do this straight away is to use  
> binary in stead of ascii. My working but extreemly unaesthetical  
> solution has been this:
> 
> for strings:
> file write slope_values %20s (trim("Intercept +OXi"))
> 
> for scalars:
> file write slope_values %20.3f (real(string(`intercept_wOXi')))
> 
> There has to be a better way. I've been able to dig up something  
> about a function called 'macval()', but I haven't been able to find  
> anything about it in the help files (search and help doesn't turn up  
> anything).

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