Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Can -outreg- show the coefficient in (eform-1)*100


From   Roger Newson <[email protected]>
To   [email protected]
Subject   st: Re: Can -outreg- show the coefficient in (eform-1)*100
Date   Mon, 30 Jun 2003 17:10:04 +0100

At 11:07 30/06/03 -0400, Renzo Comolli wrote:
Dear Statalist,

I am using -outreg- version 3.0.6  27nov00
Intercooled Stata 8.0 for Windows

I need to show the regression coefficients (which Stata stores in e(b)) in
the following format
(exp(e(b))-1)*100
is it possible to do so with -outreg-? Maybe writing a line before -outreg-?
I tried to write the following lines, but the execution breaks at the second
line:
regress ln_wage women other_regressors
replace e(b)=(exp(e(b)-1)*100)
outreg using myregression.txt, replace se

I imagine that this problem has been tackled many times before, in fact, in
the example here, the transformation (exp(b)-1)*100 has the interpretation
"women's wages are % lower than men's".

I know -outreg, eform- shows the regression coeffcients b in the form exp(b)
and adjusts the standard errors correspondently, but that's one step short
of what I need.

I looked also at -reformat- but it does not do it either. I can't use
-mktab- for unrelated reasons.
I haven't understood how to use -parmby-, so I would avoid if possible.
In fact, -parmby- has an -eform- option, and could be part of your solution. If you type

gene byte baseline=1
parmby "regress ln_wage women other_regressors baseline,noconst eform(GM/Ratio)",eform label norestore format(estimate min* max* %8.2f)
foreach X of estimate min95 max95 {
replace `X'=100*(`X'-1) if parm!="baseline"
}
list parm label estimate min95 max95

then -parmby- will call -regress-, which will display the coefficients, including the baseline male geometric mean wage, and write them (with their confidence limits and P-values) to a new data set in memory with 1 observation per parameter, overwriting your original data set. The -foreach- loop converts the parameters other than the baseline male geometric mean wage to percentage differences. The -list- command lists the parameters. (The trick with -baseline-, -eform(GM/Ratio)- and -noconst- is a way of ensuring that -regress- displays the baseline geometric mean.)

If you do not want to overwrite the existing data set in memory, then you can use the -saving- option of -parmby- instead of the -norestore- option, and save the parameters to a disk data set. You might also use -listtex- (downloadable from SSC) instead of -list-, and list the parameters in a form that can be cut and pasted into a Microsoft Word, TeX or HTML table.

I hope this helps.

Roger


--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://www.kcl-phs.org.uk/rogernewson

Opinions expressed are those of the author, not the institution.

*
* 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