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

Re: st: lnskew question


From   Roger Newson <roger.newson@kcl.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: lnskew question
Date   Mon, 09 Dec 2002 13:23:44 +0000

At 19:00 08/12/02 -0600, Robert C. Saunders wrote:
Hi,

I've been tinkering with log-transforming an outcome variable for a
regression, but I thought lnskew0 might be a good trick (and it was doing
better than ln()).  However, I wonder how I could convert the estimates
back to the natural units.  For example, I've seen the smearing technique
for converting regression estimates scaled in ln(dollars) back to dollars,
but I can't imagine what's involved in getting back from whatever it is
lnskew0 creates.  Then I thought, somebody on STATAlist might
know.  [Couldn't find anything in the list archives or manual.]
The inverse function of

y=ln(exp(x)-k)

is

x=ln(exp(y)+k)

and you can use this to back-transform the confidence interval for the arithmetic mean of y to get a confidence interval for the "lnskewometric mean" of x. (This exercise might be easier if you use my -parmest- package, downloadable from SSC, which saves the output from a model fit as a data set with 1 observartion per parameter and data on estimates, confidence limits and P-values. Type -ssc describe parmest- to find out more.)

It may be thay the "lnskewometric mean" of x is a better proxy for the median of x than either the arithmetic mean of x or the geometric mean of x. However, with a regression model, we usually want to estimate parameters that are interpreted as differences and/or ratios between means. For instance, if you regress the untransformed outcome with respect to a set of predictors, then the parameters are arithmetic means and their differences (either differences between groups or differences associated with an increment in a quantitative variable). And, if you regress the log-transformed outcome variable with respect to a set of predictors, and use the -eform(GM/ratio)- option of -regress-, then the parameters are geometric means and their ratios. There is no such interpretation if you use the -lnskew0- transformation.

One possible alternative might be to find an appropriate power transformation using the -ladder- command (see -[R] ladder- or -help ladder-). If you find such a power p, then you can transform the outcome by raising it to the power p, and then fitting a regression model using -glm- with a power 1/p link function. The parameters will then be the power p algebraic means and their differences, where the algebraic mean of a variable X is defined as (E(X^p))^(1/p) if E(.) denotes expectation. For instance, if you use the square root transform (p=0.5), then you use -the -sqrt- function to transform the data, and use -glm- with the option -link(power 2)-, and the parameters are then power 0.5 algebraic means and their differences.. Similarly, if you transform the data using the reciprocal transformation (y=1/x), and then use -glm- with the -link(power -1)- option, then the parameters estimated are power -1 algebraic means (known otherwise as harmonic means) and their differences. Sometimes, an algebraic mean is a better proxy for the median than either the arithmetic mean or the geometric mean.

Alternatively, Robert might prefer to estimate algebraic means and their ratios. This is a bit more complicated, but it can be done using -glm-, if you then modify the estimation output variables -e(b)- and -e(V)- and use the -eform- option. I have a do-file demonstration the estimation of algebraic means and their differences and ratios in the -auto- data, and I can send Robert (or anybody else) a copy if they wish..

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: roger.newson@kcl.ac.uk

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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index