Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: estout: table of several univariate results in one column and esttab error


From   "Jannik Helweg-larsen" <[email protected]>
To   [email protected]
Subject   st: estout: table of several univariate results in one column and esttab error
Date   Sun, 17 Jun 2007 19:10:23 +0200

(Stata 9.2/WinXP/WinEdt:)

I'm trying to automate the generation of postestimation output;
Ultimately I want to produce a Latex table, which in  the first column
lists several univariate unadjusted regression results and in the next
column lists the corresponding adjusted results- something like this:

Predictor   Unadjusted(HR 95%CI)      Adjusted (HR 95%CI)    .

Var1          x.(x.x-x.x)                      x.x(x.x-x.x)

Var2          x.x(x.x- x.x)                    x.x(x.x-x.x)

Var3            etc                                  etc.

I was thinking that maybe I could get it with a combination of estout
and parmest- I prefer the output options of estout/esttable-, but been
struggling with the syntax and have not succeeded in getting the
esyntax right.

1. Is it somehow possible to  get esta/esttab to list several
estimation (e.g esto1+ esto2+ esto3) in a single column?

Example:

use "http://www.stata-press.com/data/r9/stan3.dta";
global tflist ""
global modseq=0
foreach X of var age year surgery {
global modseq=$modseq+1
tempfile tf$modseq
eststo: parmby "stcox `X'",eform
idn($modseq)saving(`tf$modseq',replace) flist(tflist)
   }
dsconcat $tflist

save "C:\DATA\tempstan1.dta, replace"

use "http://www.stata-press.com/data/r9/stan3.dta";
eststo:stcox age year surgery

esttab *, eform

----------------------------------------------------------------------------
                     (1)             (2)             (3)             (4)
                      _t              _t              _t              _t
----------------------------------------------------------------------------
age                 1.032*                                          1.030*
                  (2.20)                                          (2.18)

year                                0.840*                          0.887
                                 (-2.57)                         (-1.77)

surgery                                             0.349*          0.373*
                                                 (-2.45)         (-2.26)
----------------------------------------------------------------------------
N                     172             172             172             172
----------------------------------------------------------------------------
Exponentiated coefficients; t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

Is it possible to get (1), (2) and (3) in the same column and suppress
" N"?. Alternatively is it possible to append the results of several
stored univariate eststo results into one single output/table instead
of several single tables?


2. Esttab error:: When I use esttab in the command line of stata- I
get the following error:

" esttab *
option nofirst not allowed
r(198);

but curiously, esta works allright. However if use "esttab" in batch
mode from WinEdt- then both esttab and esta are working allright..?

thanks


--
Jannik Helweg-Larsen, MD DMSc
Department of Infectious Diseases M 5131
Rigshospitalet University Hospital
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index