Announcement

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

  • Exporting event rates into excel

    Hi,

    I am trying to find a way to use 'putexcel' in combination with the stptime command (or strate), specifically when event rates are calculated for the categories within a categorical variable (with 2 or more categories). For example, event rates by deprivation category, of which there are 5.

    putexcel set [filename]
    stset time2event, failure(event==1) id(id)
    stptime, per(100) by(depcat)
    putexcel A1=(r(rate)) B1=(r(lb)) C1=(r(ub))

    Using the above code exports the overall event rate and confidence intervals (the scalars stored are for the overall cohort), but I would like to export either the event rate for a single category of the depcat variable, or the whole output table.

    Thank you in advance for any advice.



  • #2
    You can use asdoc to export the result. Here is one example.
    Code:
    webuse diet
    stset dox, origin(time dob) enter(time doe) id(id) scale(365.25) fail(fail==1 3 13) noshow
    stptime, per(1000) by(hienergy)
    asdoc stptime, per(1000) by(hienergy) replace
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	42.9 KB
ID:	1587323



    asdocx can do even better. It can export to Excel, Word or LaTeX. See details here https://fintechprofessor.com/asdocx/
    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.

    Comment

    Working...
    X