Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Need help to comeup with predicted mean after xtgee


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Need help to comeup with predicted mean after xtgee
Date   Mon, 21 Jun 2010 00:23:40 -0700 (PDT)

--- On Mon, 21/6/10, tlum@umn.edu wrote:
> I am running an xtgee regression on a large time series data.
> The dependent variable is a log transformed person-month
> medical costs. The model is:
> 
> . xi: xtgee ln_medicaidMC i.state <snip>,
> family(gamma) link(log)
<snip>
> . predict mean_sample if e(sample)
> 
> . gen expmean_sample=exp( mean_sample)
> The pmt_mc is the raw person-month medical cost without
> transformation. The mean_sample is the predicted mean (see
> command above) and the expmean_sa~e is the exp(
> mean_sample). Since the predicted mean (mean_sample) is
> exp(xb), I suppose it is in dollar amount, not the log
> transformed dollar amount. But, mean of the mean_sample is
> too slow compare with the pmt_mc (raw medical costs), 3.017
> vs 529.66. But the the expmean_sa~e is loo large compared
> with the raw medicaid coss.

In your model you moddeled ln(E(ln(pmt_mc))), that is, the
logarithm of the expected value of the logarithm of medical
cost, while you probably want to model ln(E(pmt_mc)). In
-xtgee- and -glm- it is the -link- option that takes care
of the transformations, you should _not_ transform the 
dependent variables yourself. So your model should probably
be:

xi: xtgee pmt_mc i.state <snip>, family(gamma) link(log)

A nice article that discusses this use of the link function
to take care of transformations rahter than doing it yourself
is:

Nicholas J. Cox, Jeff Warburton, Alona Armstrong, Victoria J. Holliday 
(2007) "Fitting concentration and load rating curves with generalized
linear models" Earth Surface Processes and Landforms, 33(1):25--39.
<http://www3.interscience.wiley.com/journal/114281617/abstract>

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

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