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]
RE: st: question: an example of xtmixed: testing differences between groups at specific times
From
"Sun, Wensheng" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: question: an example of xtmixed: testing differences between groups at specific times
Date
Sat, 12 Jan 2013 08:16:02 -0600
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: [email protected] [[email protected]] On Behalf Of Joerg Luedicke [[email protected]]
Sent: Thursday, January 10, 2013 1:27 PM
To: [email protected]
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 <[email protected]> wrote:
> Hi, Joerg,
>
> I got it. Thanks.
>
> Carol
>
> ________________________________________
> From: [email protected] [[email protected]] On Behalf Of Joerg Luedicke [[email protected]]
> Sent: Wednesday, January 09, 2013 8:20 AM
> To: [email protected]
> 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 <[email protected]> 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/