Announcement

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

  • Saving value (N or percentage) after a tabulate command and using it in putdocx

    Hi STATA-users,

    I ´d like to write my report directly in stata with the putdocx tool and want to report simple descriptive statistics.
    After using the summarize command it is possible to use the automatically saved results with `r(x)'.
    Has someone experience with storing values of cells after using a tabulate command?
    I´d tried it with matrix commands, but I didn´t get it.

    I´ll give you a simple example, what I mean:

    I want to report how many doctors are working in a single praxis.
    The variable "praxis" has two values: 1 = single praxis and 2 = group praxis.

    tab praxis
    Pratice Freq Percent Cum.
    single practice 158 35,91 35,91
    group practice 282 64,09 100,00
    Total 440 100,00
    I want to report with putdoxc, that 35,91 percent of doctors are working in a single practice.

    I know the putdoxc command is like this:
    putdocx text ("??? % are working in a single practice.")

    How do I get the 35,91 % in the text?

    Many thanks in advance!

    Anna

    Anna Volkert (Arntz)
    Research Associate

    IMVR - Institute für Medical Sociology, Health Service Research and Rehabilitation Science
    Faculty of Human Sciences
    Faculty of Medicine
    University of Cologne

  • #2
    I found the solution on my own:

    estpost tabulate praxis
    mat list e(pct)
    mat b = e(pct)
    scalar second=b[1,2]
    putdocx text (b[1,2])
    putdocx text ("% of doctors are working in a single practice.")

    Anna Volkert (Arntz)
    Research Associate

    IMVR - Institute für Medical Sociology, Health Service Research and Rehabilitation Science
    Faculty of Human Sciences
    Faculty of Medicine
    University of Cologne

    Comment

    Working...
    X