Announcement

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

  • Export a table (or regressions) to excel format

    Hello,
    I would like to know what commands I use to export a table (or regressions) made in STATAusing the PCA (Principal Components/Correlation and Principal Components/Eigenvectors) to excel format ( .xlsx).
    Could I do that?
    Thank you.

  • #2
    To have a better idea,follows theoutput thatI want toexporttoexcel format:


    . pca QLsdiv30 HHsdiv30 PRsdiv30

    Principal components/correlation Number of obs = 5564
    Number of comp. = 3
    Trace = 3
    Rotation: (unrotated = principal) Rho = 1.0000

    -----------------------------------------------------------------------------------------------
    Component | Eigenvalue Difference Proportion Cumulative
    -------------+--------------------------------------------------------------------------------
    Comp1 | 2.06535 1.22582 0.6884 0.6884
    Comp2 | .839521 .744387 0.2798 0.9683
    Comp3 | .0951337 . 0.0317 1.0000
    --------------------------------------------------------------------------------------------

    Principal components (eigenvectors)

    ------------------------------------------------------------------------------------
    Variable | Comp1 Comp2 Comp3 | Unexplained
    -------------+------------------------------+-------------------------------------
    QLsdiv30 | 0.3618 0.9322 0.0007 | 0
    HHsdiv30 | 0.6591 -0.2564 0.7070 | 0
    PRsdiv30 | 0.6593 -0.2553 -0.7072 | 0
    ------------------------------------------------------------------------------------

    .
    end of do-file


    I want to export these results in table format (Excel). Can I do that?
    The idea is to save time, because I have a big data to run and keep typing all tables (one by one) in excel will be long, so my request for help.

    Thank's.

    Comment


    • #3
      As all of these results from the principal component analysis are stored in scalars and matrices ( see -help pca-), you can export them in the format you want using Stata's new command -putexcel - for Stata 13 or 14. It will take still a lot more time of yours than just copy and past, unless you are going to do this task repeatedly.
      Best - Sartaj

      Comment


      • #4
        Sartaj,
        Thank's.
        I was able to do what I wanted.
        Thank's for the suggestion.
        Rafa.

        Comment

        Working...
        X