Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Re: Prediction after xtgee


From   "Joseph Coveney" <[email protected]>
To   <[email protected]>
Subject   st: Re: Prediction after xtgee
Date   Mon, 19 Jul 2010 16:22:43 +0900

Terry Lum wrote:

I ran a xtgee regression, with a list of chronic illnesses as right hand 
side variables, together which a few demographic and health insurance 
variables. The dependent variable is health care cost. I want to see how 
each chronic illness affect the costs, after controlling for demographic 
and insurance variables.

I generated the predicted value of the cost variable and summarize the 
predict costs by chronic illness. It seems that this may not be the correct 
way to do so. It seems that they may not be the right way to do so. I 
should set all chronic illness variable to zero except the targeted one. I 
tried to use the following comment

predict newvar if chronic1==1 & chronic2==0 $ chronic3==0...... &e(sample)

But it seems that by using this comment, STATA only predicted the costs for 
those observation with chronic==1.

Please suggest the corrected way to generate predicted cost for each 
chronic illness.

--------------------------------------------------------------------------------

-margins- might provide a better approach.  Something like

xtset . . .
xtgee medical_cost i.chronic_illness c.demographic_variable_1 . . . ///
  c.insurance_variable_1 . . ., family(igaussian) corr(independent) robust
margins i.chronic_illness, post

See its help-file for more options, e.g., setting covariates to specific 
values, and accessing the prediction vector and covariance matrix for forming 
contrasts and the like.

Joseph Coveney


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index