Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
tlum@umn.edu |

To |
statalist@hsphsun2.harvard.edu |

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

Date |
21 Jun 2010 10:31:45 -0500 |

thanks a lot. very helpful. Terry On Jun 21 2010, Maarten buis wrote:

--- 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 careof the transformations, you should _not_ transform thedependent variables yourself. So your model should probablybe: 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 generalizedlinear 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/

-- Terry Lum, Ph.D., M.S.W. Associate Professor School of Social Work University of Minnesota 612.624.4722 * * 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/

**References**:**Re: st: Need help to comeup with predicted mean after xtgee***From:*Maarten buis <maartenbuis@yahoo.co.uk>

- Prev by Date:
**Re: AW: st: AW: float to numeric??** - Next by Date:
**st: Svy poststratification VS Pweighting** - Previous by thread:
**Re: st: Need help to comeup with predicted mean after xtgee** - Next by thread:
**st: model fit comparison for xtgee** - Index(es):