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]

RE: st: Omnibus effects following xtmelogit with margins


From   "Ploutz-Snyder, Robert (JSC-SK)[USRA]" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Omnibus effects following xtmelogit with margins
Date   Fri, 24 Sep 2010 12:19:10 -0500

Thanks Michael,

First... there was a glitch in my code-- the ">0 "was not supposed to be in the code (leftover from prev command that I stripped out).

The true command is:
 
xtmelogit y i.time##i.group cov1 cov2 ||subj: ||time:, nolog

Here is why... This is data from a completely nested experimental design, where y is measured 10 consecutive days at each of three times. The 10 replications are conducted because the thing we are measuring (viral load in a very small quantity sample) is very difficult to obtain, thus the 10 repetitions.  So we don't expect nor care to look for changes among the 10 consecutive measurements, but we do need to incorporate the cluster.


So per subject, y is obtained 10x per time, thus time is nested within subject.  I am not trying to model a random slope for time, but rather incorporate the double-nesting in my data.

Does that make more sense?






-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Michael N. Mitchell
Sent: Friday, September 24, 2010 12:05 PM
To: [email protected]
Subject: Re: st: Omnibus effects following xtmelogit with margins

Dear Rob

   I wonder if you really want to specify the -xtmelogit- command as you have. I am 
wondering if you really wanted to do what you showed (repeated below)...

. xtmelogit y i.time##i.group cov1 cov2 >0 ||subj: ||time:, nolog

   or whether you want to do this...

. xtmelogit y i.time##i.group cov1 cov2 >0 ||subj: time, nolog

   I am thinking you might have intended the latter because that specifies a random 
intercept, as well as a random coefficient for the effect of time (at the subject level). 
The question that remains for me is whether you need to do something special because 
-time- is a factor variable, perhaps it is -||subj: R.time-, but I am not sure since I 
have never done this and see very little documentation on this.

   If this is the way you want to specify your model, then I think it might solve your 
-margins- problem.

I hope this helps,

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com



On 2010-09-24 8.26 AM, Ploutz-Snyder, Robert (JSC-SK)[USRA] wrote:
> Happy Friday Statalisters.
>
> I'm hoping someone can verify that -testparm- works appropriately to test the highest-order ominibus interaction effects following -xtmelogit- (as it works with xtmixed, for example). I also ran into a snag using -margins- as I usually do after an -xtmixed- model to obtain omnibus main effects for an ordinal factor variable.
>
>   My model includes an indicator for time (three times) and an indicator for group (two groups) plus two continuous covariates.
>
> xtmelogit y i.time##i.group cov1 cov2>0 ||subj: ||time:, nolog
>
> ...output omitted...
>
>
> My test of the omnibus interaction effect  (as I would run following xtmixed) revealed:
>
> . testparm time#group2
>
>   ( 1)  [eq1]2.time#10000.group2 = 0
>   ( 2)  [eq1]3.time#10000.group2 = 0
>
>             chi2(  2) =    6.46
>           Prob>  chi2 =    0.0396
>
> But my use of -margins- to get the omnibus main effect for time (as I would with xtmixed) failed:
>
> . margins time, asbalanced atmeans
> default prediction is a function of possibly stochastic quantities other than e(b)
> r(498);
>
>
> Any assistance on this error?  Rob
>
> *
> *   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/
*
*   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/

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