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

st: file write handle?

From   Sean Shu <>
Subject   st: file write handle?
Date   Mon, 14 Nov 2005 10:53:56 -0500

Hi, Here:

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!

Best regards

Sean Shu
Health Information Analyst
HKPR District Health Unit
200 Rose Glen Road
Port Hope, ON
L1a 3V6

905-885-9100 ext. 252

* For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index