Announcement

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

  • Export matrix to Word with asdocx after the predict command

    Prof River Huang asked the following question
    Dear Attaullah, Is it possible to put the results of "predict f1-f2" (below) into a word file? Thanks.
    Code:
    sysuse auto, clear pca trunk weight length headroom predict f1-f2
    Yes, it can be exported to a word / Excel or LaTeX document using asdocx. Since the preidct command leaves behind a fully-developed matrix, we can use the asdocx's sub-command wmat (write matrixt) to export this matrix to Word.
    Code:
    sysuse auto, clear
    pca trunk weight length headroom
    predict f1-f2
    
    mat cof = r(scoef)
    asdocx wmat, mat(cof) replace
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	12.7 KB
ID:	1601660

    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

  • #2
    Dear Attaullah, Thanks for the suggestion.
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

    Comment

    Working...
    X