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

st: Re: parmby & Beta


From   Roger Newson <[email protected]>
To   [email protected]
Subject   st: Re: parmby & Beta
Date   Tue, 15 Jul 2003 15:55:36 +0100

At 09:17 15/07/03 -0500, Fred Wolfe wrote:
Is there anyway to get -parmby- output to include beta (Beta), as in:

parmby "reg cutdown high pain_ haq_ depress glb age sex edlevel white inctouse duration, beta", saving(testme, replace) for(estimate min95 max95 %8.2f p %8.1e) li(*)
This is not a simple thing to do, because -regress- does not save any such estimation result as -e(Beta)-. However, you could always standardise your Y- and X-variables before doing your regression, as in the following program:

foreach X of var cutdown high pain_ haq_ depress glb age sex edlevel white inctouse duration {
summ `X'
replace `X'=(`X'-r(mean))/r(sd)
}
parmby "reg cutdown high pain_ haq_ depress glb age sex edlevel white inctouse duration, beta", saving(testme, replace) for(estimate min95 max95 %8.2f p %8.1e) li(*)

This would code all your Y- and X-variables to a scale of SDs from the mean, causing -estimate-, -min95- and -max95- to be expressed in Y-axis SDs per X-axis SD. To eliminate missing values listwise, you might type instead:

gene byte listmiss=0
foreach X of var cutdown high pain_ haq_ depress glb age sex edlevel white inctouse duration {
replace listmiss=1 if missing(`X')
}
foreach X of var cutdown high pain_ haq_ depress glb age sex edlevel white inctouse duration {
replace `X'=. if listmiss
summ `X'
replace `X'=(`X'-r(mean))/r(sd)
}
parmby "reg cutdown high pain_ haq_ depress glb age sex edlevel white inctouse duration, beta", saving(testme, replace) for(estimate min95 max95 %8.2f p %8.1e) li(*)

This would recode all your X- and Y-variables to missing in observations where any of the variables were previously missing, or to a scale of SDs from the mean otherwise, where the SDs and means are from observations not deleted listwise.

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