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: Margins & marginsplot with a multi-level model


From   "Jilke, S.R." <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Margins & marginsplot with a multi-level model
Date   Wed, 2 May 2012 08:30:51 +0000

Kendra,

You may include 'predict(mu fixedonly)' after your margins command.  However, pls note that this will give you only the values of the fixed part of your model. 

 You may find further advice here:

http://www.ats.ucla.edu/stat/stata/faq/xtmelogit_prob.htm

sebastian

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kendra Lewis
Sent: woensdag 2 mei 2012 1:33
To: [email protected]
Subject: st: Margins & marginsplot with a multi-level model

Hello,

I am running an xtmelogit model, and would like to run the margins & marginsplot commands afterwards, but am receiving an error. If I take out the "cluster" variable and run a logit model, the commands work just fine.

Here is the model, followed by the error message:

. xtmelogit drunkt5 drugedt5##treatms  if drunkt1  == 0 ||cluster:

Refining starting values:

Iteration 0:   log likelihood = -3988.7591  (not concave) Iteration 1:   log likelihood = -3952.4376 Iteration 2:   log likelihood = -3952.1877

Performing gradient-based optimization:

Iteration 0:   log likelihood = -3952.1877 Iteration 1:   log likelihood = -3952.1877

Mixed-effects logistic regression               Number of obs      =      8547 Group variable: cluster                         Number of groups   =        82

                                               Obs per group: min =         5
                                                              avg =     104.2
                                                              max =       347

Integration points =   7                        Wald chi2(3)       =     31.01 Log likelihood = -3952.1877                     Prob > chi2        =    0.0000

----------------------------------------------------------------------------------
        drunkt5 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+------------------------------------------------------
-----------------+----------
     1.drugedt5 |   .3720199   .0954558     3.90   0.000     .1849299
  .5591099
      1.treatms |   .5823083   .1318417     4.42   0.000     .3239032
  .8407133
                |
drugedt5#treatms |
           1 1  |    -.73265   .1383434    -5.30   0.000    -1.003798
 -.4615019
                |
          _cons |  -1.741293   .0788033   -22.10   0.000    -1.895744
 -1.586841
----------------------------------------------------------------------------------

------------------------------------------------------------------------------
 Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------
-----------------------------+------
cluster: Identity            |
                  sd(_cons) |   .3424621   .0427972      .2680641    .4375085
------------------------------------------------------------------------------
LR test vs. logistic regression: chibar2(01) =    70.20 Prob>=chibar2 = 0.0000 r; t=5.95 15:39:50


. margins drugedt5, at(treatms= (0 1))
default prediction is a function of possibly stochastic quantities other than e(b) r(498); t=0.78 15:40:40

Any suggestions? Thanks!

--
Kendra Lewis, Ph.D.
Certified Family Life Educator (provisional) Graduate Research Assistant Human Development & Family Science Oregon State University [email protected]

*
*   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/
--------------------------------Disclaimer--------------------------------
De informatie  verzonden in dit e-mail bericht  inclusief de bijlage(n) is
vertrouwelijk  en is  uitsluitend  bestemd  voor de geadresseerde  van dit
bericht. Lees verder: http://www.eur.nl/email-disclaimer

The information in this e-mail message  is confidential and may be legally
privileged. Read more: http://www.eur.nl/english/email-disclaimer
--------------------------------------------------------------------------

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