asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum Export output from factor command in Stata to Excel

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Will Hall
    Post count: 2

    Thank you so much for your help with asdocx. I am trying to export to excel using this code.

    asdocx factor [varlist], ipf mineigen(1) factors(10) blanks(.33)

    Any idea how to make it work.

    Attaullah Shah
    Post count: 70

    Adding support for factor will take some time. However, you can quickly export the tables of factor command using the wmat command of asdocx, that is writing matrix. See this example.

    * Load example data
    webuse bg2, clear
    * Run the factor command
    factor bg2cost1-bg2cost6
    * Save the matrix in L
    mat L = e(L)
    * Export the matrix with asdocx using wmat command
    asdocx wmat, mat(L) replace title(Factor loadings (pattern matrix)
    Factor loadings (pattern matrix) and unique variances
    Factor1 Factor2 Factor3
    bg2cost1 0.247 0.367 -0.045
    bg2cost2 -0.337 0.332 -0.077
    bg2cost3 -0.376 0.376 0.02
    bg2cost4 -0.322 0.194 0.103
    bg2cost5 0.455 0.248 0.064
    bg2cost6 0.476 0.236 -0.007
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.