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

st: RE: Re: exporting VCV to .csv format


From   "Nick Winter" <nwinter@policystudies.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Re: exporting VCV to .csv format
Date   Thu, 1 Aug 2002 10:53:56 -0400

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

This should also work:

 . matrix V = e(V)
 . svmat V* , names(matcol)
 . outsheet V* using myfile.csv in 1/#
 . drop V*


This assumes you don't have any variables that begin with capital V; if
you do, use a different name for the matrix in the first line.

You should switch the "in 1/#" to reflect the number of rows in the
matrix (ie, if the model has four variables, including a constant, then
it would be "in 1/4".  Without this, there will be blank lines for the
blank observations in the dataset.

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