Announcement

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

  • Creating a correlation table in Word using polychor + esttab

    Hello everyone,

    I have a question regarding the user-written command -polychoric-. Based on this post in the Stata forum, I have been able to extract the return matrix from polychoric, save it to a Stata matrix and export it an .rtf file using esttab matrix(correlations). I have now tried to use esttab to change how many decimals are displayed. However, I have had no luck so far with different combinations of "cells(fmt(X))". My assumption is that esttab does not recognized the correlations as coefficients and thus is not able to change the decimals. I am not sure if there is a fix.

    Code:
    use https://www.stata-press.com/data/r17/nlsw88.dta
    polychoric age race married industry occupation union
    matrix correlations = r(R)
    esttab matrix(correlations) using "Yourfilepath/Correlations.rtf", replace label cells(fmt(%9.4f))
    Last edited by Felix Kaysers; 29 Nov 2022, 06:19.
    Cheers,
    Felix
    Stata Version: MP 18.0
    OS: Windows 11

  • #2
    The matrix() specification is not documented in help esttab, so it is passed through to estout, and help estout tells us the following is appropriate.
    Code:
    esttab matrix(correlations, fmt(%9.4f)) using "~/Downloads/Correlations.rtf", replace label

    Comment


    • #3
      Thank you William Lisowski, that did the trick!
      Cheers,
      Felix
      Stata Version: MP 18.0
      OS: Windows 11

      Comment

      Working...
      X