Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: lincom output into a formatted table

From   Eduardo Nunez <>
Subject   st: lincom output into a formatted table
Date   Wed, 11 Apr 2012 15:17:31 -0400

Dear Statalisters,
I would appreciate any help in how to get the results from a lincom
command into a formatted table (either MS Word or Excel).
Knowing that lincom save the results as r(estimate), r(se) and r(df),
how can I get the results expressed in the table as exp_coeff,
P-value, and 95% CI(lb - ub).
Is there an automated way to do it?
I have tried lincomest, from Roger Newson (ssc), but is not compatible
with stpm2 from Patrick Royston.

Here is an example:
stset exitusev_days, f(exitusev) id(pid) scale(365.25)
stpm2 edad_1 bnp_i_1 pcr_i_1 bbloq aco estatina i.nyha
i.iBUNQ2_ca35##FED_120_1, scale(hazard) df(3) eform
testparm iBUNQ2_ca35#FED_120_1

lincom 1.FED_120_1 + 1.iBUNQ2_ca35#1.FED_120_1, hr cformat(%3.2f)
lincom 1.FED_120_1 + 2.iBUNQ2_ca35#1.FED_120_1, hr cformat(%3.2f)
lincom 1.FED_120_1 + 3.iBUNQ2_ca35#1.FED_120_1, hr cformat(%3.2f)
lincom 1.FED_120_1 + 4.iBUNQ2_ca35#1.FED_120_1, hr cformat(%3.2f)

Categories     HR     P-value     95% lower bound - 95% upper bound
C1                X.XX     0.XXX         1.XXX - 1.XXX
C2                X.XX     0.XXX         1.XXX - 1.XXX
C3                X.XX     0.XXX         1.XXX - 1.XXX
C4                X.XX     0.XXX         1.XXX - 1.XXX

Best wishes,
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index