asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum Does the asdocx command leave behind any matrix like in asdoc?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • Bayzidur Rahman
    Participant
    Post count: 3

    Does the asdocx command generate any matrix is the asdoc?

    I want to replicate the following commands with asdocx. Can you please help?

    asdoc tabstat overall_pct overall_tot if pract==1 & dup==0, stats(mean min max) replace label
    
    matrix a=r(StatTotal)
    
    Dr. Attaullah Shah
    Keymaster
    Post count: 106

    asdocx leaves behind a well-formed Mata matrix. The matrix name is output. Therefore, if you run asdocx with any Stata command, you can directly access the output matrix by typing

    mata:output

    And yes in the case of the tabstat command, asdocx leaves behind a Stata matrix. This matrix is named C and you can get it and modify it just like any other Stata matrix. So the display this matrix, you can type:

    matlist C 

    Or make a copy of it

    mat A = C
    Bayzidur Rahman
    Participant
    Post count: 3

    Thanks, I got it.

    However, the label of the variables are not saved in the matrix. That is my only reason to use asdocx. Can you please help me with this?

    Dr. Attaullah Shah
    Keymaster
    Post count: 106

    By the way, why do you need to access this matrix. You can use flexmat to modify this matrix easily and the re-export to word. You might find this post helpful

    https://asdocx.com/flexmat-create-flexible-tables-in-stata-mata/

    https://www.statalist.org/forums/forum/general-stata-discussion/general/1598416-export-frequency-table

    Bayzidur Rahman
    Participant
    Post count: 3

    Thanks for the information. I am not sure if I am missing something. Can we create a Stata matrix with flexmat? I can modify an Stata matrix with flexmat but that does not reman as a Stata matrix.

    Dr. Attaullah Shah
    Keymaster
    Post count: 106

    Stata matrices have one limitation, and it is a big one. It cannot have string or text. Therefore, Stata matrices are not a good tool for holding and managing results. This is why I chose to write matrices in the Mata language. Still, you have not told why you need to add information to the Stata matrix?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.