Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • mixed coefficient and contrast

    Dear all,

    I am runnign a mixed model to test if wakeup time differs between "data acquisition" (dummy variable - daqn), day of the week (week day vs weekend, dummy var - dayn) and their interaction.
    Is it possible to obtain a significant coefficient for daqn and then a non significant contrast for daqn?

    Code:
    mixed wakeup i.daqn##i.dayn, || id_num:, vce(robust) 
    
    Performing EM optimization ...
    
    Performing gradient-based optimization: 
    Iteration 0:   log pseudolikelihood = -212.42025  
    Iteration 1:   log pseudolikelihood = -212.42025  
    
    Computing standard errors ...
    
    Mixed-effects regression                        Number of obs     =        132
    Group variable: id_num                          Number of groups  =         66
                                                    Obs per group:
                                                                  min =          2
                                                                  avg =        2.0
                                                                  max =          2
                                                    Wald chi2(3)      =     111.98
    Log pseudolikelihood = -212.42025               Prob > chi2       =     0.0000
    
                                    (Std. err. adjusted for 66 clusters in id_num)
    ------------------------------------------------------------------------------
                 |               Robust
          wakeup | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          1.daqn |  -.8120616   .1814687    -4.47   0.000    -1.167734   -.4563894
          1.dayn |   1.220362   .1535683     7.95   0.000     .9193742    1.521351
                 |
       daqn#dayn |
            1 1  |   .7679294   .4227739     1.82   0.069    -.0606923    1.596551
                 |
           _cons |   32.23869    .165786   194.46   0.000     31.91376    32.56363
    ------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
                                 |               Robust           
      Random-effects parameters  |   Estimate   std. err.     [95% conf. interval]
    -----------------------------+------------------------------------------------
    id_num: Identity             |
                      var(_cons) |   1.234817   .2997978      .7672585      1.9873
    -----------------------------+------------------------------------------------
                   var(Residual) |    .679776   .1303579      .4668038    .9899137
    ------------------------------------------------------------------------------
    
    
    
    margins daqn dayn daqn#dayn, pwcompare (effects) mcompare(bonferroni)
    
    Pairwise comparisons of predictive margins                 Number of obs = 132
    Model VCE: Robust
    
    Expression: Linear prediction, fixed portion, predict()
    
    ---------------------------
                 |    Number of
                 |  comparisons
    -------------+-------------
            daqn |            1
            dayn |            1
       daqn#dayn |            6
    ---------------------------
    
    ---------------------------------------------------------------------------------
                    |            Delta-method    Bonferroni           Bonferroni
                    |   Contrast   std. err.      z    P>|z|     [95% conf. interval]
    ----------------+----------------------------------------------------------------
               daqn |
            1 vs 0  |  -.4280969    .289916    -1.48   0.140    -.9963217     .140128
                    |
               dayn |
            1 vs 0  |   1.359986   .1446243     9.40   0.000     1.076528    1.643444
                    |
          daqn#dayn |
    (0 1) vs (0 0)  |   1.220362   .1535683     7.95   0.000     .8152099    1.625515
    (1 0) vs (0 0)  |  -.8120616   .1814687    -4.47   0.000    -1.290823   -.3333004
    (1 1) vs (0 0)  |    1.17623   .4475623     2.63   0.052    -.0045541    2.357015
    (1 0) vs (0 1)  |  -2.032424   .2390805    -8.50   0.000     -2.66318   -1.401668
    (1 1) vs (0 1)  |  -.0441321   .4738571    -0.09   1.000    -1.294289    1.206025
    (1 1) vs (1 0)  |   1.988292   .3938967     5.05   0.000     .9490912    3.027493
    ---------------------------------------------------------------------------------

    Many thanks in advance.

  • #2
    Well, as you have seen, it is possible. The question is, what does it mean? The answer is, nothing, really.

    You have used an interaction model. You have, therefore, stipulated that there is no such thing as "the effect of daqn." Rather you have said that there are two different effects of daqn, one when dayn = 0 and the other when dayn = 1. The coefficient of daqn in the regression output is equal to the effect of daqn when dayn = 0. Now, notice that the coefficient of the interaction term, 0.77 (to 2 decimal places) is opposite in sign to the coefficient of daqn, -0.81, and almost equal in magnitude. The effect of daqn when dayn = 1 is the sum of those two, so -0.04, which is pretty close to zero.

    What does the contrast output for daqn tell you? It tells you the difference between the outcome variable, wakeup, when daqn = 1 and daqn = 0 averaged over the values of dayn in the data. So it is an average of some 0.77's and some -0.04's and depending on the distribution of dayn, it could be anywhere between those two. As it turns out in your case it is about 1/2 of the way down from 0.77 towards -0.04. And as it turns out, given the level of residual variation in wakeup and the sample size, that turns out not to be "significant."

    Comment


    • #3
      Thank you very much for the clear explanation, Clyde.

      Given the small sample size and the unbalanced design of this dataset, would it maybe be a
      Code:
      mixed wakeup i.daqn##i.dayn, || id_num:, reml dfmethod(kroger)
      approach recommeded instead?

      Many thanks in advance.

      Comment


      • #4
        There is a rule of thumb that REML is preferred if the number of groups minus the number of fixed effect df minus one is < 50. You have 132 groups, and 3 fixed effect df, so you don't need to go to REML.

        Comment

        Working...
        X