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]

From |
Joerg Luedicke <joerg.luedicke@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: question: an example of xtmixed: testing differences between groups at specific times |

Date |
Mon, 14 Jan 2013 15:05:11 -0500 |

You should do all testing on transformed scale. As for marginal predictions, retransformation can be quite awkward with such nonlinear transformations. Have a look at, for example, Willard G. Manning, The logged dependent variable, heteroscedasticity, and the retransformation problem, Journal of Health Economics, Volume 17, Issue 3, June 1998, Pages 283-295, ISSN 0167-6296, 10.1016/S0167-6296(98)00025-3. (http://www.sciencedirect.com/science/article/pii/S0167629698000253) Willard G Manning, John Mullahy, Estimating log models: to transform or not to transform?, Journal of Health Economics, Volume 20, Issue 4, July 2001, Pages 461-494, ISSN 0167-6296, 10.1016/S0167-6296(01)00086-8. (http://www.sciencedirect.com/science/article/pii/S0167629601000868) Cox, Nicholas J., Warburton, Jeff, Armstrong, Alona, Holliday, Victoria J., Fitting concentration and load rating curves with generalized linear models. Earth Surface Processes and Landforms 33(1), 2008: 25-39 (http://dx.doi.org/10.1002/esp.1523) for general takes on the issue. The issue should further be complicated in the multilevel context where you have more than one error term. However, I can't think of a paper/book right now that is discussing these issues for multilevel models. In the vein of the above mentioned paper by Nick Cox and colleagues, you could perhaps consider a generalized multilevel model with a log link, which you could do with -gllamm- (from SSC). If you are not specifically interested in estimating the variances for your varying intercepts and slopes, and if following the GLM approach would be an option for you, then using population averaged models (GEE) may be the easiest solution here (-help xtgee-). Joerg On Sat, Jan 12, 2013 at 9:16 AM, Sun, Wensheng <wsun@bcm.edu> wrote: > Thank you, Joerg. > > One more question, if I did log-transformation, or sqrt transformation on dependent variable in the begining > > gen sqrt_weight=sqrt(weight) > > xtmixed sqrt_weight c.age##i.girl || id: age, cov(uns) res(ind) mle variance > > after I got estimated mean and std. error from margin command, how should I re-transform them to non-sqrt or non-log forms? > > Thanks. > > Carol > > ________________________________________ > From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] On Behalf Of Joerg Luedicke [joerg.luedicke@gmail.com] > Sent: Thursday, January 10, 2013 1:27 PM > To: statalist@hsphsun2.harvard.edu > Subject: Re: st: question: an example of xtmixed: testing differences between groups at specific times > > Vince Wiggins of StataCorp told me off-list that > > "-margins- can perform the linear combination and tests for you > directly. Just insert a contrast operator on the factor variable girl." > > He provides an example with the auto dataset (-sysuse auto-): > > . regress mpg c.length##i.foreign > > . margins r.foreign, at(length=(150 170 190 210)) > > > I am still using Stata 11 and therefore am not familiar with the new > -margins- features of Stata 12. I should have pointed that out in my > post. > > Joerg > > > On Wed, Jan 9, 2013 at 9:41 PM, Sun, Wensheng <wsun@bcm.edu> wrote: >> Hi, Joerg, >> >> I got it. Thanks. >> >> Carol >> >> ________________________________________ >> From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] On Behalf Of Joerg Luedicke [joerg.luedicke@gmail.com] >> Sent: Wednesday, January 09, 2013 8:20 AM >> To: statalist@hsphsun2.harvard.edu >> Subject: Re: st: question: an example of xtmixed: testing differences between groups at specific times >> >> If by "compare" you mean hypothesis testing, try >> >> margins girl, at(age=(0.5 1 1.5 2)) coefl post >> >> Then, for example, testing the difference between boys and girls at >> baseline would be: >> >> test _b[1bn._at#0bn.girl] = _b[1bn._at#1.girl] >> >> To test the difference between age 0.5 and age 1 for boys would be: >> >> test _b[1bn._at#0bn.girl] = _b[2._at#0bn.girl] >> >> If you were interested in estimating the difference including a >> confidence interval between age 0.5 and age 1 for boys, you could >> type: >> >> lincom _b[2._at#0bn.girl] - _b[1bn._at#0bn.girl] >> >> >> Joerg >> >> >> On Tue, Jan 8, 2013 at 8:49 PM, Sun, Wensheng <wsun@bcm.edu> wrote: >>> Hi, >>> >>> I am using –xtmixed- on a longitudinal study with planned measurements at 0, 6, 12 and 24 months, but very few follow-up measurements at the planned time. I have fitted the model and need to evaluate changes from baseline and also differences between two treatment groups at exactly 6, 12 and 24 months. The –xtmixed- followed by –margins- gives margins and standard error at each time. How do I compare them? I am using Stata 12 for Windows. >>> >>> An example of that in public shared data should be >>> >>> . webuse childweight >>> . xtmixed weight c.age##i.girl || id: age, cov(uns) res(ind) mle variance >>> . margin girl, at(age=(0.5 1 1.5 2)) >>> >>> What STATA commands should I use if I want to compare the weight between boys and girls at age of 0.5, 1, 1.5, and 2? and How should I compare changes from .5-year to 1 or 1.5 or 2 in girls and boys? >>> >>> Thank you very much! >>> >>> >>> Carol >>> * >>> * For searches and help try: >>> * http://www.stata.com/help.cgi?search >>> * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**References**:**st: question: an example of xtmixed: testing differences between groups at specific times***From:*"Sun, Wensheng" <wsun@bcm.edu>

**Re: st: question: an example of xtmixed: testing differences between groups at specific times***From:*Joerg Luedicke <joerg.luedicke@gmail.com>

**RE: st: question: an example of xtmixed: testing differences between groups at specific times***From:*"Sun, Wensheng" <wsun@bcm.edu>

**Re: st: question: an example of xtmixed: testing differences between groups at specific times***From:*Joerg Luedicke <joerg.luedicke@gmail.com>

**RE: st: question: an example of xtmixed: testing differences between groups at specific times***From:*"Sun, Wensheng" <wsun@bcm.edu>

- Prev by Date:
**Re: st: Slowing process when running a program with multiple nested loops** - Next by Date:
**Re: st: Bootstrap with xtregar fails** - Previous by thread:
**RE: st: question: an example of xtmixed: testing differences between groups at specific times** - Next by thread:
**st: IV and matching estimator** - Index(es):