Statalist


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

RE: st: Interpretation of regressionmodel of ln-transformed variable


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Interpretation of regressionmodel of ln-transformed variable
Date   Wed, 5 Nov 2008 12:33:16 -0800

You can expect differences since your model transforms the response
variable, while the glm transforms the mean function.  Sorry about the
eform business - I just copied your line.

The model you cite below fits log(mu)=XB, while your other model fit
E(log(y))=XB.  For non-linear functions these won't be the same.

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of roland
andersson
Sent: Wednesday, November 05, 2008 11:07 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Interpretation of regressionmodel of ln-transformed
variable

Peter and Maarten

I am sorry Peter. Your model is not accepted by Stata. I tried
different alternativ without success.

However I tried Maarten GLM model

xi: glm studytime i.drug c_age cons, family(gaussian) link(log) nocons
eform

on my data and got a different result compared to the regress of the
lnLOS. Now laparoscopy has shorter LOS. Which method is correct?
						
		           OIM
LOS	                  exp(b)	Std. Err.	z
P>z	         [95% Conf.	Interval]
						
lapscopiin~n	.9564416	.0177129	-2.40	         0.016
.9223473	.9917961
_Iappdgn2_1	1.877733	.0296501	39.90	 0.000	1.82051
1.936755
_Iappdgn2_3	1.261943	.0406183	7.23	         0.000
1.184792	1.344118
_Ialderkat_0	1.217428	.033424	7.17	        0.000	1.153649
1.284732
_Ialderka~20	.9216973	.0248353	-3.03	        0.002
.874284	.9716818
_Ialderka~30	.9769093	.0266964	-0.85	        0.393
.9259619	1.03066
_Ialderka~40	1.042333	.0310393	1.39	        0.164
.9832382	1.104979
_Ialderka~50	1.193937	.0329973	6.41	        0.000
1.130984	1.260394
_Ialderka~60	1.288248	.0401942	8.12	        0.000
1.211829	1.369486
_Ialderka~70	1.627175	.0499963	15.84	0.000	1.532076
1.728176
_Ialderka~80	2.187109	.0728674	23.49	0.000	2.048855
2.334693
prepermalign	1.309315	.0431838	8.17	        0.000
1.227354	1.39675
precardios~s	1.055536	.0380158	1.50	        0.133
.9835957	1.132739
preperlung~d	1.173726	.0379413	4.96	        0.000
1.101669	1.250496
preperhype~i	1.031919	.0318163	1.02	        0.308
.9714069	1.096201
preperhjar~t	1.217436	.049107	4.88	        0.000	1.124894
1.31759
prepernjur~t	1.438939	.1225243	4.27	        0.000
1.217765	1.700284
preperdiab~s	1.110856	.0446201	2.62	        0.009
1.026756	1.201844
cons	                2.244081	.0400108	45.33	0.000
2.167015	2.323887
						

Greetings
Roland


2008/11/5 Lachenbruch, Peter <Peter.Lachenbruch@oregonstate.edu>:
> The issue seems to be that hospitals have a closure date on stay when
> you are doing a study after patients are certain (or almost certain)
to
> have been discharged (e.g., all records are from admissions at least a
> year old).
>
> An alternative model might fit the reciprocal of the mean rather than
> the log of the observations (thus obviating problems with 0 days of
stay
> - e.g. an outpatient visit to the ER)  in this case you could use
> generalized linear models to get
> xi: glm LOS  lapscopic i.appdgn age agesq cons, eform("exp(b)")
> link(power -1) nocons
>
>
> Tony
>
> Peter A. Lachenbruch
> Department of Public Health
> Oregon State University
> Corvallis, OR 97330
> Phone: 541-737-3832
> FAX: 541-737-4001
>
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Maarten
buis
> Sent: Wednesday, November 05, 2008 1:49 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: Interpretation of regressionmodel of ln-transformed
> variable
>
> --- roland andersson <rolandersson@gmail.com> wrote:
>> It is also difficult to imaging that there should be censoring
>> for conditions that normally need 1 to 7 days of hospital visit.
>
> Ok, sounds reasonable.
>
>> Following your example I have made this model
>>
>> xi:regress lnLOS  lapscopic i.appdgn age agesq cons, eform("exp(b)")
>> nocons
>>
>> and get this result
>>
>> lnLOS         exp(b)      [95% Conf.  Interval]
>> lapscopic     1.018056    1.004532    1.031762
>> _Iappdgn2_1   1.850726    1.824841    1.876978
>> _Iappdgn2_3   1.174283    1.147247    1.201956
>> age           .9852508    .9841405    .9863623
>> agesq         1.000275    1.000261    1.000289
>> cons          2.208685    2.168225    2.2499
>>
>> I now understand that the exp(b) is a multiplicator, ie that open
>> appendectomy has a geometric mean LOS of 2.21 days whereas
>> laparoscopic patients have 1.02*2.21=2.25 days or 0.04 days longer
>> geometric mean LOS. Is it correct to recalculate the CI of this
>> difference as 2.21-1.0045*2.21=0.01 and 2.21-1.032*2.21=0.07?
>
> In that case I would use -adjust- and -nlcom- like in the example
> below:
>
> *--------------- begin example --------------------------
> sysuse cancer, clear
> gen ln_t = ln(studytime)
> gen cons = 1
> xi: reg ln_t i.drug age cons, nocons eform("exp(b)")
>
> adjust _Idrug_3=0 age, by(_Idrug_2) exp ci
> sum age if e(sample)
> nlcom exp((_b[cons] + _b[age]*`r(mean)')+ _b[_Idrug_2]) -  ///
>      exp((_b[cons] + _b[age]*`r(mean)'))
> *---------------- end example ---------------------------
>
> Notice that the difference in LOS now depends on the values of the
> other explanatory variables. These other variables define the baseline
> LOS (in your case the LOS for someone who received an open
> appendectomy). So if you haven't mean centered age, then the
difference
> in geometric mean LOS you reported applies to newly born babies. You
> can report the difference in geometric mean LOS for someone of average
> age either by first mean centering age (subtract the mean age from the
> variable age as I did in the example in my previous post), or take
mean
> age into account like in the example above.
>
> Hope this helps,
> Maarten
>
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
>
> visiting address:
> Buitenveldertselaan 3 (Metropolitan), room N515
>
> +31 20 5986715
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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