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

Re: st: How to export results readable by Excel


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to export results readable by Excel
Date   Thu, 01 Aug 2002 15:29:00 +0100

At 10:30 01/08/02 +0800, James Ferng wrote:
Hello!

I am a new user of stata. I have a problem of exporting the
covariance-variance of estimate (after regress) to a external file with
extension, such as csv (or any data format with comma as seperation). The
command 'outsheet' is not working for this. Can someone tell me how to do
this? Thank you!
To copy a the columns of variance-covariance matrix to a set of variables, use the -svmat- command on the matrix -e(V)- created by an estimation command. The new variables can then be output using -outsheet- like any other variables. See -[P] matrix mkmat- in the Stata programming manual.

For instance, James might type

regress mpg weight foreign
svmat e(V),names(vvector)
outsheet vvector* using vv1.csv,comma replace

and this should create a set of variables -vvector1-, -vvector2- and -vvector3-, which are output to a file -vv1.csv-.

If James wants to output estimates and/or confidence intervals and/or P-values to a spreadsheet, rather than a covariance matrix, then he might like to find out about the -parmest- package, which saves estimation output as a Stata data set. In Web-aware Stata, type -ssc describe parmest- to find out more, and type -ssc install parmest- to install the -parmest- package over the Web from the SSC site.

I hope this helps.

Roger


--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: roger.newson@kcl.ac.uk

Opinions expressed are those of the author, not the institution.

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