Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exporting variance-covariance matrix in Excel or Latex

    Dear All,

    is there any chance to export a variance-covariance matrix from Stata to Latex or Excel?

    I run the following:

    Code:
    use http://www.stata-press.com/data/r15/auto
    regress price weight mpg
    matrix V=get(VCE)
    matrix list V
    So how can I export the matrix to Excel or Latex. Please notice that the above is just an example. In my actual estimation I have more than 20 parameters. Hence, I am looking for a solution that will do the export automatically rather than copying the result manually.

    Thanks in advance.

    Dario

  • #2
    The putexcel command should prove useful to you.
    Code:
    sysuse auto, clear
    regress price weight mpg
    matrix V=get(VCE)
    matrix list V
    putexcel set results, replace
    putexcel A1 = matrix(V), names
    putexcel close
    Click image for larger version

Name:	Screen Shot 2018-08-09 at 9.24.46 PM.png
Views:	1
Size:	35.1 KB
ID:	1457522

    Comment


    • #3
      Thanks William. I tried the wrong way. This is exactly what I need.

      Comment

      Working...
      X