Bookmark and Share

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


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

st: Problem with outreg


From   Wameq Raza <[email protected]>
To   [email protected]
Subject   st: Problem with outreg
Date   Wed, 30 Jan 2013 13:00:52 +0530

Dear Stata users,
I'm facing some problem creating a whole document of tables using
outreg and was hoping someone would be able to help me. I have about 6
tables that I need to be able to put in one single document (for
brevity's sake I'm including the syntax for the first 2). What happens
when I fun the following is that the first table comes out just fine,
but as soon as the second table runs, it ends up replacing the first
one in the document. By the time the syntax finishes running for all 6
tables, I'm just left with Table number 6 in the document and the rest
aren't there.

I have isolated the problem to the second regression for table 2. The
first regression seems to be fine, but when it comes to running outreg
for the second one, it deletes all the results from table 1. If I add
in "addtable" along with merge, then the problem of deletion goes
away, but I'm also left with an extra row that I have to manually
delete. Depending on the number of regressions, this really builds up!
I have a feeling I'm overlooking some simple mistake, but I'm not
being able to put my finger on it.

Could anyone please kindly suggest a solution?
Best
Wameq


*Table 1:
reg lna att in_att YE var1 var2 var3
outreg using table, ctitle("Variable", "Short term Illnesses")
starloc(1) starlevels(10 5 1) se replace
reg lnc att in_att YE var1 var2 var3
outreg using table, ctitle("Variable", "Long term Illnesses")
starloc(1) starlevels(10 5 1) merge se
reg lni att in_att YE var1 var2 var3
outreg using table, ctitle("Variable", "Inpatient Care") title ("OLS
results for health care expenses (Dep var: total health care cost for
the last visit to the doctor)") starloc(1) starlevels(10 5 1)//
//merge note("The figures show marginal effects and standard errors
for each category") se

*Table 2:
probit care_hw_a_all att in_att YE var1 var2 var3
margins, dydx (_all)
outreg using table, addtable marginal ctitle("Variable", "Short term
Illnesses") starloc(1) starlevels(10 5 1) se
probit care_hw_c_all att in_att YE var1 var2 var3
margins, dydx (_all)
outreg using table, merge marginal ctitle("Variable", "Long term
Illnesses") starloc(1) starlevels(10 5 1) se
probit care_hw_i_all att in_att YE var1 var2 var3
margins, dydx (_all)
outreg using table, marginal ctitle("Variable", "Inpatient Care")
title ("Probit results for who reports an illness (Dep var: Binary var
for those who reported an illness)") starloc(1) starlevels(10 5// //1)
merge note("The figures show marginal effects and standard errors for
each category") se


--
W A M E Q   R A Z A
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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