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

st: RE: file write handle?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: file write handle?
Date   Mon, 14 Nov 2005 16:00:35 -0000

lb1 is not a variable, but a scalar. 

Try parentheses, as indicated in the help for -file-: 

file write handle "the upper confidence interval is: " (lb1)

Nick 
[email protected] 

Sean Shu
 
> I need write the caculated result from my program together with some 
> interpretation text into a text file. STATA seems that it is only 
> capable of writing interpretation text into the specified 
> text, but not 
> for caculated result. Please look at the following code:
> 
> ...
> svymean dummy1 dummy2
>    mat define b= e(b)
>    mat define v= e(V)
>    scalar lb1 = b[1,1] - invttail(e(df_r), 0.025)*sqrt(v[1,1])
>    scalar ub1 = b[1,1] + invttail(e(df_r), 0.025)*sqrt(v[1,1])
> 
> file open handle using C:\temp\output.txt, write text
> file write handle "RRFSS 2005 "
> file write handle "Module objectives: "
> 
> file write handle "the upper confidence interval is: " lb1
> file close handle
> 
> After running the program, I found that the value of the 
> variable "lb1" 
> is not written into the text file. So I wonder whether there 
> is a way to 
>   output the value of a variable into a text file.   Thanks!

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