- Stata manual
- -file- - Read and write text and binary files
- Slaymaker (2005).Using the file command to produce formatted output for other applications
- -display- - Display strings and values of scalar expressions
- -log- - Echo copy of session to file
- Saving and printing output - log files
- -outfile- - Export dataset in text format
- UCLA: How do I use to write results or other information to an external text file?
- Example:
- cap program drop coeftab
- program coeftab
- args per dec wth
- #del ;
- if "`per'"=="" {; local per=100; };
- if "`dec'"=="" {; local dec=2; };
- if "`wth'"=="" {; local wth=4; };
- #del cr
- mat R=r(table)'
- mat rtable=R[1...,"b"]
- local rows=rowsof(rtable)
- local names: rownames rtable
- disp _skip(24) "estimate (LL, UL) estimate (SE) p-value"
- forvalues i=1/`rows' {
- disp "`:word `i' of `names''" _column(25) ///
- %`wth'.`dec'f rtable[`i',1] ///
- " (" %`wth'.`dec'f rtable[`i',2] ///
- ", " %`wth'.`dec'f rtable[`i',3] ")" ///
- _skip(10) %`wth'.`dec'f rtable[`i',1] ///
- " (" %`wth'.`dec'f rtable[`i',4] ///
- ")" _skip(10) %5.3f rtable[`i',5]
- }
- end
Disclaimer: This blog site is intended solely for sharing of information. Comments are warmly welcome, but I make no warranties regarding the quality, content, completeness, suitability, adequacy, sequence, or accuracy of the information.
Saturday, July 14, 2018
Stata: Output the results into text files
Stata: Output the results into text files
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment