Announcement

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

  • Seemingly inconsistent contrast results after poisson and margins

    Hi all

    I am working on data from a randomized controlled experiment where subjects were randomly assigned to one of four groups and given a shopping task in a virtual online grocery store. I'll denote the groups as: Control, WL, T, WLT. The outcome I am interested in is the number of products containing red meat in the shopping basket at checkout. In the present analysis, I am examining interactions between a number of subject characteristics and the effect of each treatment (e.g., WL vs. Control). I am only interested in associations, so I fit separate Poisson regressions with an indicator variable for the study arm, the moderator of interest (e.g., gender), and their interaction. To see if the treatment effects differ by these suject characteristics, I compute these effects separately at each level of the moderator and do a homogeneity test using contrast.

    I am having trouble understanding the results for two of the moderators of interest, namely summary measures of a subject's interest in health and interest in sustainability. These measures are simple averages of items measured on a 1-5 Likert scale (two items for the health measure, five for the sustainability measure). For now I am treating these as continuous variables because they take non-integer values. I follow the procedure above conditioning on values 1, 2, 3, 4, and 5. In each case I get strong rejections, but when I compute pairwise comparisons, none is statistically significant. OLS finds no interaction and the point estimates and standard errors for the conditional treatment effects are similar to the Poisson ones. Similarly, when I treat the moderators as categorical variables (alternately rounding up and down), contrast's results agree with OLS. Interestingly, contrast's output shows that the degrees of freedom for the problematic case (Poisson with continuous moderator) are not equal to 4 (the number of restrictions I am testing), but 3 (one restriction gets dropped).

    Code and output for interest in health below. Diagnostics plots not shown for conciseness (slight nonnormality of the Anscombe residuals in the tails and no apparent relationships in the residual vs. fitted plots). Code and output for the Poisson regressions with categorical moderator in #2 (character limit).

    The P values that I think should more or less correspond yet do not are in red; in OLS these are just the P values for each interaction term because of linearity, i.e. if they are significant the difference in treatment effects at int_health = x and int_health = y will be significant, I think.

    Thanks for any help anyone can provide (and apologies for the long post but more information is better than less).

    Maxime

    Preliminaries:
    Code:
    . summarize redmeat, detail
    
                 Number of red meat items purchased
    -------------------------------------------------------------
          Percentiles      Smallest
     1%            0              0
     5%            0              0
    10%            1              0       Obs               3,518
    25%            2              0       Sum of Wgt.       3,518
    
    50%            3                      Mean           3.144116
                            Largest       Std. Dev.      1.717456
    75%            4              9
    90%            5              9       Variance       2.949654
    95%            6             10       Skewness       .0920231
    99%            7             12       Kurtosis       2.792986
    
    . histogram redmeat, discrete percent
    (start=0, width=1)
    
    . tabstat redmeat, stats(variance mean) by(arm) format(%4.2f) nototal
    
    Summary for variables: redmeat
         by categories of: arm (Arm)
    
        arm |  variance      mean
    --------+--------------------
    Control |      2.84      3.50
         WL |      3.22      3.24
          T |      2.71      3.07
        WLT |      2.73      2.76
    -----------------------------
    
    .
    Poisson, int_health continuous:
    Code:
    . glm redmeat arm##c.int_health, family(poisson) vce(robust)
    
    Iteration 0:   log pseudolikelihood = -6773.6041  
    Iteration 1:   log pseudolikelihood = -6765.4898  
    Iteration 2:   log pseudolikelihood = -6765.4867  
    Iteration 3:   log pseudolikelihood = -6765.4867  
    
    Generalized linear models                         Number of obs   =      3,490
    Optimization     : ML                             Residual df     =      3,482
                                                      Scale parameter =          1
    Deviance         =  3814.697748                   (1/df) Deviance =   1.095548
    Pearson          =  3146.128499                   (1/df) Pearson  =   .9035406
    
    Variance function: V(u) = u                       [Poisson]
    Link function    : g(u) = ln(u)                   [Log]
    
                                                      AIC             =   3.881654
    Log pseudolikelihood = -6765.486681               BIC             =  -24590.26
    
    ----------------------------------------------------------------------------------
                     |               Robust
             redmeat |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -----------------+----------------------------------------------------------------
                 arm |
                 WL  |    .075889    .089114     0.85   0.394    -.0987712    .2505493
                  T  |  -.1667416   .0964557    -1.73   0.084    -.3557913    .0223081
                WLT  |  -.1822114    .103245    -1.76   0.078    -.3845679    .0201451
                     |
          int_health |     -.0812   .0167178    -4.86   0.000    -.1139663   -.0484337
                     |
    arm#c.int_health |
                 WL  |  -.0439101   .0241868    -1.82   0.069    -.0913154    .0034952
                  T  |    .008172   .0261055     0.31   0.754    -.0429938    .0593378
                WLT  |  -.0174026   .0279498    -0.62   0.534    -.0721832     .037378
                     |
               _cons |   1.562273   .0624578    25.01   0.000     1.439858    1.684688
    ----------------------------------------------------------------------------------
    
    .
    . // Diagnostics
    .
    . gof // Program for deviance and Pearson goodness-of-fit tests as per estat gof after poisson
    
    Goodness-of-fit test statistic   Prob > chi2(3482)
    Deviance = 3814.698              0.0001
    Pearson  = 3146.128              1.0000
    
    . predict anscombe, anscombe
    (28 missing values generated)
    
    . predict deviance, deviance
    (28 missing values generated)
    
    . predict pearson, pearson
    (28 missing values generated)
    
    . summarize anscombe deviance pearson
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
        anscombe |      3,490   -.1254524    1.065312   -3.14559   4.024217
        deviance |      3,490   -.1144572    1.039349  -2.965691   3.980549
         pearson |      3,490   -.0000243    .9495935   -2.09706   5.334105
    
    . qnorm anscombe, msize(small) mfcolor(navy%50) mlwidth(thin)
    
    . predict fitted
    (option mu assumed; predicted mean redmeat)
    (28 missing values generated)
    
    . foreach r in anscombe deviance pearson {
      2.         lowess `r' fitted, msize(small) mfcolor(navy%50) mlwidth(thin) lineopts(lcolor(midblue)) name(`r'_lowess, replace)
      3. }
    
    . drop fitted anscombe deviance pearson
    
    .
    . // Moderation tests
    .
    . testparm arm#c.int_health
    
     ( 1)  [redmeat]2.arm#c.int_health = 0
     ( 2)  [redmeat]3.arm#c.int_health = 0
     ( 3)  [redmeat]4.arm#c.int_health = 0
    
               chi2(  3) =    4.88
             Prob > chi2 =    0.1812
    
    . margins, dydx(arm) at(int_health = (1(1)5)) post vsquish
    
    Conditional marginal effects                    Number of obs     =      3,490
    Model VCE    : Robust
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    
    1._at        : int_health      =           1
    2._at        : int_health      =           2
    3._at        : int_health      =           3
    4._at        : int_health      =           4
    5._at        : int_health      =           5
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    1.arm        |  (base outcome)
    -------------+----------------------------------------------------------------
    2.arm        |
             _at |
              1  |   .1429054   .2956879     0.48   0.629    -.4366322    .7224431
              2  |  -.0480895   .1792539    -0.27   0.788    -.3994208    .3032417
              3  |  -.2030383   .0995889    -2.04   0.041    -.3982291   -.0078476
              4  |  -.3272395   .0859704    -3.81   0.000    -.4957384   -.1587405
              5  |  -.4252858   .1252607    -3.40   0.001    -.6707922   -.1797794
    -------------+----------------------------------------------------------------
    3.arm        |
             _at |
              1  |  -.6448573   .2885458    -2.23   0.025    -1.210397   -.0793178
              2  |  -.5661724   .1783523    -3.17   0.002    -.9157364   -.2166084
              3  |  -.4956238   .0981094    -5.05   0.000    -.6879146   -.3033329
              4  |  -.4324359    .084127    -5.14   0.000    -.5973219     -.26755
              5  |  -.3759039   .1304803    -2.88   0.004    -.6316406   -.1201673
    -------------+----------------------------------------------------------------
    4.arm        |
             _at |
              1  |  -.7957709   .2993894    -2.66   0.008    -1.382563   -.2089784
              2  |   -.791002   .1826672    -4.33   0.000    -1.149023   -.4329808
              3  |  -.7812252    .099314    -7.87   0.000    -.9758771   -.5865733
              4  |  -.7673363   .0840066    -9.13   0.000    -.9319863   -.6026863
              5  |  -.7501138   .1282987    -5.85   0.000    -1.001575    -.498653
    ------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    . marginsplot, ylabel(-2(1)2) xlabel(.) xtitle("Interest in health (lowest to highest)") legend(order(4 "WL" 5 "T" 6 "WLT") row(1)) name(healthPOIS, replace)
    
      Variables that uniquely identify margins: int_health _deriv
    
    . contrast _at, atequations vsquish
    
    Contrasts of conditional marginal effects       Number of obs     =      3,490
    Model VCE    : Robust
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    
    1._at        : int_health      =           1
    2._at        : int_health      =           2
    3._at        : int_health      =           3
    4._at        : int_health      =           4
    5._at        : int_health      =           5
    
    ------------------------------------------------
                 |         df        chi2     P>chi2
    -------------+----------------------------------
    1b.arm       |
             _at |  (omitted)
    -------------+----------------------------------
    2.arm        |
             _at |          3       33.76     0.0000
    -------------+----------------------------------
    3.arm        |
             _at |          3       33.32     0.0000
    -------------+----------------------------------
    4.arm        |
             _at |          3       98.37     0.0000
    ------------------------------------------------
    
    . pwcompare _at, atequations effects vsquish
    
    Pairwise comparisons of conditional marginal effects
    
    Model VCE    : Robust                           Number of obs     =      3,490
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    
    1._at        : int_health      =           1
    2._at        : int_health      =           2
    3._at        : int_health      =           3
    4._at        : int_health      =           4
    5._at        : int_health      =           5
    
    ------------------------------------------------------------------------------
                 |   Contrast Delta-method    Unadjusted           Unadjusted
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    1.arm        |  (base outcome)
    -------------+----------------------------------------------------------------
    2.arm        |
             _at |
         2 vs 1  |   -.190995   .1251792    -1.53   0.127    -.4363418    .0543518
         3 vs 1  |  -.3459438    .228219    -1.52   0.130    -.7932449    .1013573
         4 vs 1  |  -.4701449   .3124983    -1.50   0.132     -1.08263    .1423405
         5 vs 1  |  -.5681912   .3808993    -1.49   0.136     -1.31474    .1783578
         3 vs 2  |  -.1549488   .1030833    -1.50   0.133    -.3569883    .0470907
         4 vs 2  |  -.2791499   .1874477    -1.49   0.136    -.6465407    .0882408
         5 vs 2  |  -.3771962   .2559733    -1.47   0.141    -.8788947    .1245023
         4 vs 3  |  -.1242011   .0844072    -1.47   0.141    -.2896362    .0412339
         5 vs 3  |  -.2222474   .1530172    -1.45   0.146    -.5221557    .0776608
         5 vs 4  |  -.0980463   .0686529    -1.43   0.153    -.2326035    .0365109
    -------------+----------------------------------------------------------------
    3.arm        |
             _at |
         2 vs 1  |   .0786849   .1177887     0.67   0.504    -.1521767    .3095465
         3 vs 1  |   .1492335   .2196351     0.68   0.497    -.2812433    .5797104
         4 vs 1  |   .2124214   .3072645     0.69   0.489     -.389806    .8146487
         5 vs 1  |   .2689534   .3822329     0.70   0.482    -.4802094    1.018116
         3 vs 2  |   .0705487   .1018483     0.69   0.489    -.1290703    .2701677
         4 vs 2  |   .1337365   .1894815     0.71   0.480    -.2376405    .5051135
         5 vs 2  |   .1902685   .2644557     0.72   0.472    -.3280552    .7085922
         4 vs 3  |   .0631878   .0876352     0.72   0.471     -.108574    .2349497
         5 vs 3  |   .1197198   .1626134     0.74   0.462    -.1989965    .4384361
         5 vs 4  |    .056532   .0749802     0.75   0.451    -.0904265    .2034904
    -------------+----------------------------------------------------------------
    4.arm        |
             _at |
         2 vs 1  |    .004769   .1244258     0.04   0.969     -.239101     .248639
         3 vs 1  |   .0145457    .229435     0.06   0.949    -.4351386    .4642301
         4 vs 1  |   .0284346   .3174964     0.09   0.929     -.593847    .6507162
         5 vs 1  |   .0456571   .3907904     0.12   0.907    -.7202779    .8115922
         3 vs 2  |   .0097768   .1050169     0.09   0.926    -.1960526    .2156062
         4 vs 2  |   .0236656   .1930936     0.12   0.902    -.3547909    .4021222
         5 vs 2  |   .0408882   .2664102     0.15   0.878    -.4812662    .5630426
         4 vs 3  |   .0138889   .0880844     0.16   0.875    -.1587534    .1865311
         5 vs 3  |   .0311114   .1614165     0.19   0.847    -.2852591    .3474819
         5 vs 4  |   .0172225     .07334     0.23   0.814    -.1265212    .1609663
    ------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    .
    Click image for larger version

Name:	MEsPOIS.png
Views:	2
Size:	110.1 KB
ID:	1637261

    OLS, int_health continuous:
    Code:
    . regress redmeat arm##c.int_health
    
          Source |       SS           df       MS      Number of obs   =     3,490
    -------------+----------------------------------   F(7, 3482)      =     26.58
           Model |  520.290212         7  74.3271732   Prob > F        =    0.0000
        Residual |  9738.00893     3,482  2.79667115   R-squared       =    0.0507
    -------------+----------------------------------   Adj R-squared   =    0.0488
           Total |  10258.2991     3,489  2.94018319   Root MSE        =    1.6723
    
    ----------------------------------------------------------------------------------
             redmeat |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -----------------+----------------------------------------------------------------
                 arm |
                 WL  |    .207299   .3561368     0.58   0.561    -.4909589     .905557
                  T  |  -.6925493   .3646463    -1.90   0.058    -1.407491    .0223929
                WLT  |  -.8232045   .3700983    -2.22   0.026    -1.548836   -.0975729
                     |
          int_health |  -.2942289   .0656121    -4.48   0.000    -.4228709   -.1655869
                     |
    arm#c.int_health |
                 WL  |  -.1320273    .091971    -1.44   0.151    -.3123498    .0482952
                  T  |   .0644555   .0944202     0.68   0.495    -.1206691    .2495801
                WLT  |   .0139352   .0957076     0.15   0.884    -.1737134    .2015838
                     |
               _cons |   4.630014   .2548842    18.17   0.000     4.130276    5.129752
    ----------------------------------------------------------------------------------
    
    . estat hettest
    
    Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
             Ho: Constant variance
             Variables: fitted values of redmeat
    
             chi2(1)      =     0.57
             Prob > chi2  =   0.4511
    
    . testparm arm#c.int_health
    
     ( 1)  2.arm#c.int_health = 0
     ( 2)  3.arm#c.int_health = 0
     ( 3)  4.arm#c.int_health = 0
    
           F(  3,  3482) =    1.63
                Prob > F =    0.1803
    
    . margins, dydx(arm) at(int_health = (1(1)5)) post vsquish
    
    Conditional marginal effects                    Number of obs     =      3,490
    Model VCE    : OLS
    
    Expression   : Linear prediction, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    
    1._at        : int_health      =           1
    2._at        : int_health      =           2
    3._at        : int_health      =           3
    4._at        : int_health      =           4
    5._at        : int_health      =           5
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    1.arm        |  (base outcome)
    -------------+----------------------------------------------------------------
    2.arm        |
             _at |
              1  |   .0752718    .267286     0.28   0.778    -.4487813    .5993249
              2  |  -.0567555   .1815697    -0.31   0.755    -.4127492    .2992383
              3  |  -.1887828   .1068204    -1.77   0.077    -.3982197    .0206542
              4  |    -.32081    .082286    -3.90   0.000    -.4821437   -.1594763
              5  |  -.4528373    .138017    -3.28   0.001    -.7234397   -.1822348
    -------------+----------------------------------------------------------------
    3.arm        |
             _at |
              1  |  -.6280937   .2733197    -2.30   0.022    -1.163977   -.0922107
              2  |  -.5636382   .1851236    -3.04   0.002    -.9265999   -.2006766
              3  |  -.4991827   .1080193    -4.62   0.000    -.7109703   -.2873951
              4  |  -.4347272    .083042    -5.24   0.000    -.5975431   -.2719113
              5  |  -.3702717   .1412591    -2.62   0.009    -.6472306   -.0933127
    -------------+----------------------------------------------------------------
    4.arm        |
             _at |
              1  |  -.8092692   .2774444    -2.92   0.004    -1.353239   -.2652991
              2  |   -.795334   .1878774    -4.23   0.000    -1.163695   -.4269729
              3  |  -.7813988   .1092719    -7.15   0.000    -.9956422   -.5671554
              4  |  -.7674636    .083082    -9.24   0.000    -.9303579   -.6045693
              5  |  -.7535284   .1420731    -5.30   0.000    -1.032083   -.4749733
    ------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    . marginsplot, ylabel(-2(1)2) xlabel(.) xtitle("Interest in health (lowest to highest)") legend(order(4 "WL" 5 "T" 6 "WLT") row(1)) name(healthOLS, replace)
    
      Variables that uniquely identify margins: int_health _deriv
    
    .
    Click image for larger version

Name:	MEsOLS.png
Views:	1
Size:	110.0 KB
ID:	1637262
    Last edited by Maxime Bercholz; 19 Nov 2021, 10:14.

  • #2
    Poisson, int_health discrete (rounded up):
    Code:
    . generate int_health_up = round(int_health,1)
    (28 missing values generated)
    
    . recode int_health_up (1 = 2) // Too few 1s per arm
    (int_health_up: 47 changes made)
    
    . glm redmeat arm##int_health_up, family(poisson) vce(robust)
    
    Iteration 0:   log pseudolikelihood = -6777.9313  
    Iteration 1:   log pseudolikelihood = -6769.7539  
    Iteration 2:   log pseudolikelihood = -6769.7507  
    Iteration 3:   log pseudolikelihood = -6769.7507  
    
    Generalized linear models                         Number of obs   =      3,490
    Optimization     : ML                             Residual df     =      3,474
                                                      Scale parameter =          1
    Deviance         =  3823.225716                   (1/df) Deviance =   1.100526
    Pearson          =  3154.447938                   (1/df) Pearson  =   .9080161
    
    Variance function: V(u) = u                       [Poisson]
    Link function    : g(u) = ln(u)                   [Log]
    
                                                      AIC             =   3.888682
    Log pseudolikelihood = -6769.750665               BIC             =  -24516.47
    
    -----------------------------------------------------------------------------------
                      |               Robust
              redmeat |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ------------------+----------------------------------------------------------------
                  arm |
                  WL  |   .0116619   .0663469     0.18   0.860    -.1183755    .1416994
                   T  |  -.1595298   .0768314    -2.08   0.038    -.3101166   -.0089429
                 WLT  |  -.2349864   .0772982    -3.04   0.002     -.386488   -.0834847
                      |
        int_health_up |
                   3  |  -.1152145   .0599587    -1.92   0.055    -.2327313    .0023023
                   4  |  -.1097252   .0502538    -2.18   0.029    -.2082209   -.0112295
                   5  |  -.2539152   .0577465    -4.40   0.000    -.3670962   -.1407342
                      |
    arm#int_health_up |
                WL#3  |  -.0538421   .0884725    -0.61   0.543     -.227245    .1195608
                WL#4  |  -.1080092   .0743057    -1.45   0.146    -.2536456    .0376272
                WL#5  |  -.1335245   .0864283    -1.54   0.122    -.3029209    .0358718
                 T#3  |    .067757   .0929411     0.73   0.466    -.1144043    .2499182
                 T#4  |  -.0004366    .083624    -0.01   0.996    -.1643366    .1634633
                 T#5  |   .0473545   .0964108     0.49   0.623    -.1416072    .2363163
               WLT#3  |     .05422   .0964031     0.56   0.574    -.1347266    .2431667
               WLT#4  |  -.0372598   .0852784    -0.44   0.662    -.2044023    .1298828
               WLT#5  |  -.0101015   .0974818    -0.10   0.917    -.2011623    .1809594
                      |
                _cons |   1.394593   .0452602    30.81   0.000     1.305885    1.483302
    -----------------------------------------------------------------------------------
    
    . gof
    
    Goodness-of-fit test statistic   Prob > chi2(3474)
    Deviance = 3823.226              0.0000
    Pearson  = 3154.448              1.0000
    
    . predict anscombe, anscombe
    (28 missing values generated)
    
    . predict deviance, deviance
    (55 missing values generated)
    
    . predict pearson, pearson
    (28 missing values generated)
    
    . summarize anscombe deviance pearson
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
        anscombe |      3,490   -.1256333    1.066478  -3.030091   4.115109
        deviance |      3,463    -.115524    1.044505  -2.856797   4.067855
         pearson |      3,490   -1.97e-09    .9508482  -2.020061   5.502991
    
    . qnorm anscombe, msize(small) mfcolor(navy%50) mlwidth(thin)
    
    . predict fitted
    (option mu assumed; predicted mean redmeat)
    (28 missing values generated)
    
    . foreach r in anscombe deviance pearson {
      2.         lowess `r' fitted, msize(small) mfcolor(navy%50) mlwidth(thin) lineopts(lcolor(midblue)) name(`r'_lowess, replace)
      3. }
    
    . drop fitted anscombe deviance pearson
    
    . testparm arm#int_health_up
    
     ( 1)  [redmeat]2.arm#3.int_health_up = 0
     ( 2)  [redmeat]2.arm#4.int_health_up = 0
     ( 3)  [redmeat]2.arm#5.int_health_up = 0
     ( 4)  [redmeat]3.arm#3.int_health_up = 0
     ( 5)  [redmeat]3.arm#4.int_health_up = 0
     ( 6)  [redmeat]3.arm#5.int_health_up = 0
     ( 7)  [redmeat]4.arm#3.int_health_up = 0
     ( 8)  [redmeat]4.arm#4.int_health_up = 0
     ( 9)  [redmeat]4.arm#5.int_health_up = 0
    
               chi2(  9) =    6.16
             Prob > chi2 =    0.7243
    
    . margins, dydx(arm) over(int_health_up) post
    
    Average marginal effects                        Number of obs     =      3,490
    Model VCE    : Robust
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    over         : int_health_up
    
    -------------------------------------------------------------------------------
                  |            Delta-method
                  |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    1.arm         |  (base outcome)
    --------------+----------------------------------------------------------------
    2.arm         |
    int_health_up |
               2  |   .0473118   .2692818     0.18   0.861    -.4804708    .5750945
               3  |  -.1484596   .2056512    -0.72   0.470    -.5515285    .2546092
               4  |  -.3319685     .11468    -2.89   0.004    -.5567371   -.1071998
               5  |  -.3589774   .1620556    -2.22   0.027    -.6766006   -.0413542
    --------------+----------------------------------------------------------------
    3.arm         |
    int_health_up |
               2  |  -.5947368   .2808927    -2.12   0.034    -1.145276   -.0441973
               3  |  -.3151848    .180999    -1.74   0.082    -.6699363    .0395667
               4  |  -.5342771   .1097474    -4.87   0.000     -.749378   -.3191761
               5  |  -.3320139   .1704825    -1.95   0.051    -.6661534    .0021256
    --------------+----------------------------------------------------------------
    4.arm         |
    int_health_up |
               2  |  -.8446541   .2706436    -3.12   0.002    -1.375106   -.3142024
               3  |  -.5944056   .1895497    -3.14   0.002    -.9659162    -.222895
               4  |  -.8613817    .111568    -7.72   0.000    -1.080051   -.6427124
               5  |  -.6801084   .1613471    -4.22   0.000    -.9963429   -.3638739
    -------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    . marginsplot, ylabel(-2(1)2) xlabel(.) xtitle("Interest in health (lowest to highest)") legend(order(4 "WL" 5 "T" 6 "WLT") row(1)) name(healthPOISup, replace)
    
      Variables that uniquely identify margins: int_health_up _deriv
    
    . contrast int_health_up, atequations
    
    Contrasts of average marginal effects           Number of obs     =      3,490
    Model VCE    : Robust
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    over         : int_health_up
    
    -------------------------------------------------
                  |         df        chi2     P>chi2
    --------------+----------------------------------
    1b.arm        |
    int_health_up |  (omitted)
    --------------+----------------------------------
    2.arm         |
    int_health_up |          3        2.33     0.5075
    --------------+----------------------------------
    3.arm         |
    int_health_up |          3        1.89     0.5963
    --------------+----------------------------------
    4.arm         |
    int_health_up |          3        1.92     0.5901
    -------------------------------------------------
    
    . pwcompare int_health_up, effects
    
    Pairwise comparisons of average marginal effects
    
    Model VCE    : Robust                           Number of obs     =      3,490
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    over         : int_health_up
    
    -------------------------------------------------------------------------------
                  |   Contrast Delta-method    Unadjusted           Unadjusted
                  |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    1.arm         |  (base outcome)
    -------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    .
    Click image for larger version

Name:	MEsPOISup.png
Views:	1
Size:	111.2 KB
ID:	1637253

    Poisson, int_health discrete (rounded down):
    Code:
    . generate int_health_down = trunc(int_health)
    (28 missing values generated)
    
    . recode int_health_down (1 = 2) // Ibid.
    (int_health_down: 86 changes made)
    
    . glm redmeat arm##int_health_down, family(poisson) vce(robust)
    
    Iteration 0:   log pseudolikelihood = -6771.2038  
    Iteration 1:   log pseudolikelihood = -6763.0139  
    Iteration 2:   log pseudolikelihood = -6763.0106  
    Iteration 3:   log pseudolikelihood = -6763.0106  
    
    Generalized linear models                         Number of obs   =      3,490
    Optimization     : ML                             Residual df     =      3,474
                                                      Scale parameter =          1
    Deviance         =  3809.745518                   (1/df) Deviance =   1.096645
    Pearson          =  3139.219893                   (1/df) Pearson  =   .9036327
    
    Variance function: V(u) = u                       [Poisson]
    Link function    : g(u) = ln(u)                   [Log]
    
                                                      AIC             =    3.88482
    Log pseudolikelihood = -6763.010566               BIC             =  -24529.95
    
    -------------------------------------------------------------------------------------
                        |               Robust
                redmeat |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------------+----------------------------------------------------------------
                    arm |
                    WL  |   .0227585   .0510607     0.45   0.656    -.0773186    .1228355
                     T  |  -.1610393   .0593521    -2.71   0.007    -.2773673   -.0447114
                   WLT  |  -.2313291   .0620492    -3.73   0.000    -.3529434   -.1097149
                        |
        int_health_down |
                     3  |  -.0568799   .0480086    -1.18   0.236     -.150975    .0372152
                     4  |  -.1360363   .0436989    -3.11   0.002    -.2216846   -.0503879
                     5  |  -.2879516   .0628356    -4.58   0.000    -.4111072    -.164796
                        |
    arm#int_health_down |
                  WL#3  |  -.1041805   .0701716    -1.48   0.138    -.2417144    .0333533
                  WL#4  |  -.1532075   .0621452    -2.47   0.014    -.2750098   -.0314053
                  WL#5  |  -.0711015   .0937052    -0.76   0.448    -.2547602    .1125573
                   T#3  |   .0063304   .0736868     0.09   0.932     -.138093    .1507538
                   T#4  |   .0435643   .0691693     0.63   0.529    -.0920051    .1791337
                   T#5  |   .0113818   .0990573     0.11   0.909    -.1827669    .2055305
                 WLT#3  |  -.0061298   .0784672    -0.08   0.938    -.1599227    .1476631
                 WLT#4  |  -.0323693   .0722752    -0.45   0.654     -.174026    .1092875
                 WLT#5  |    -.00577   .1124856    -0.05   0.959    -.2262378    .2146977
                        |
                  _cons |   1.375483   .0370484    37.13   0.000      1.30287    1.448097
    -------------------------------------------------------------------------------------
    
    . gof
    
    Goodness-of-fit test statistic   Prob > chi2(3474)
    Deviance = 3809.746              0.0000
    Pearson  = 3139.220              1.0000
    
    . predict anscombe, anscombe
    (28 missing values generated)
    
    . predict deviance, deviance
    (28 missing values generated)
    
    . predict pearson, pearson
    (28 missing values generated)
    
    . summarize anscombe deviance pearson
    
        Variable |        Obs        Mean    Std. Dev.       Min        Max
    -------------+---------------------------------------------------------
        anscombe |      3,490   -.1253025    1.064613  -3.017975   3.892703
        deviance |      3,490   -.1143144    1.038681  -2.845374    3.85386
         pearson |      3,490    1.51e-09    .9485503  -2.011983   5.095353
    
    . qnorm anscombe, msize(small) mfcolor(navy%50) mlwidth(thin)
    
    . predict fitted
    (option mu assumed; predicted mean redmeat)
    (28 missing values generated)
    
    . foreach r in anscombe deviance pearson {
      2.         lowess `r' fitted, msize(small) mfcolor(navy%50) mlwidth(thin) lineopts(lcolor(midblue)) name(`r'_lowess, replace)
      3. }
    
    . drop fitted anscombe deviance pearson
    
    . testparm arm#int_health_down
    
     ( 1)  [redmeat]2.arm#3.int_health_down = 0
     ( 2)  [redmeat]2.arm#4.int_health_down = 0
     ( 3)  [redmeat]2.arm#5.int_health_down = 0
     ( 4)  [redmeat]3.arm#3.int_health_down = 0
     ( 5)  [redmeat]3.arm#4.int_health_down = 0
     ( 6)  [redmeat]3.arm#5.int_health_down = 0
     ( 7)  [redmeat]4.arm#3.int_health_down = 0
     ( 8)  [redmeat]4.arm#4.int_health_down = 0
     ( 9)  [redmeat]4.arm#5.int_health_down = 0
    
               chi2(  9) =   10.68
             Prob > chi2 =    0.2982
    
    . margins, dydx(arm) over(int_health_down) post
    
    Average marginal effects                        Number of obs     =      3,490
    Model VCE    : Robust
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    over         : int_health_down
    
    ---------------------------------------------------------------------------------
                    |            Delta-method
                    |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
    1.arm           |  (base outcome)
    ----------------+----------------------------------------------------------------
    2.arm           |
    int_health_down |
                 2  |   .0910877   .2042621     0.45   0.656    -.3092586     .491434
                 3  |    -.29231   .1716639    -1.70   0.089    -.6287651    .0441451
                 4  |  -.4223838    .114024    -3.70   0.000    -.6458668   -.1989008
                 5  |  -.1400191   .2267703    -0.62   0.537    -.5844807    .3044426
    ----------------+----------------------------------------------------------------
    3.arm           |
    int_health_down |
                 2  |  -.5885682   .2142126    -2.75   0.006    -1.008417   -.1687193
                 3  |  -.5358165   .1517378    -3.53   0.000    -.8332171   -.2384159
                 4  |  -.3827991   .1150648    -3.33   0.001     -.608322   -.1572761
                 5  |  -.4123967   .2165863    -1.90   0.057     -.836898    .0121046
    ----------------+----------------------------------------------------------------
    4.arm           |
    int_health_down |
                 2  |  -.8172043   .2142794    -3.81   0.000    -1.237184   -.3972244
                 3  |  -.7901455   .1580355    -5.00   0.000    -1.099889   -.4804016
                 4  |  -.8005506   .1108801    -7.22   0.000    -1.017872   -.5832295
                 5  |  -.6262828    .238307    -2.63   0.009    -1.093356   -.1592097
    ---------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    . marginsplot, ylabel(-2(1)2) xlabel(.) xtitle("Interest in health (lowest to highest)") legend(order(4 "WL" 5 "T" 6 "WLT") row(1)) name(healthPOISdown, replace)
    
      Variables that uniquely identify margins: int_health_down _deriv
    
    . contrast int_health_down, atequations
    
    Contrasts of average marginal effects           Number of obs     =      3,490
    Model VCE    : Robust
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    over         : int_health_down
    
    ---------------------------------------------------
                    |         df        chi2     P>chi2
    ----------------+----------------------------------
    1b.arm          |
    int_health_down |  (omitted)
    ----------------+----------------------------------
    2.arm           |
    int_health_down |          3        5.25     0.1547
    ----------------+----------------------------------
    3.arm           |
    int_health_down |          3        1.10     0.7759
    ----------------+----------------------------------
    4.arm           |
    int_health_down |          3        0.48     0.9223
    ---------------------------------------------------
    
    . pwcompare int_health_down, atequations effects
    
    Pairwise comparisons of average marginal effects
    
    Model VCE    : Robust                           Number of obs     =      3,490
    
    Expression   : Predicted mean redmeat, predict()
    dy/dx w.r.t. : 2.arm 3.arm 4.arm
    over         : int_health_down
    
    ---------------------------------------------------------------------------------
                    |   Contrast Delta-method    Unadjusted           Unadjusted
                    |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
    1.arm           |  (base outcome)
    ----------------+----------------------------------------------------------------
    2.arm           |
    int_health_down |
            3 vs 2  |  -.3833977   .2668173    -1.44   0.151      -.90635    .1395547
            4 vs 2  |  -.5134715   .2339326    -2.19   0.028     -.971971    -.054972
            5 vs 2  |  -.2311067   .3052012    -0.76   0.449    -.8292901    .3670766
            4 vs 3  |  -.1300738   .2060824    -0.63   0.528     -.533988    .2738404
            5 vs 3  |   .1522909   .2844174     0.54   0.592     -.405157    .7097388
            5 vs 4  |   .2823647   .2538233     1.11   0.266    -.2151198    .7798492
    ----------------+----------------------------------------------------------------
    3.arm           |
    int_health_down |
            3 vs 2  |   .0527517   .2625098     0.20   0.841     -.461758    .5672614
            4 vs 2  |   .2057691   .2431603     0.85   0.397    -.2708164    .6823546
            5 vs 2  |   .1761715   .3046254     0.58   0.563    -.4208833    .7732263
            4 vs 3  |   .1530174   .1904318     0.80   0.422    -.2202221    .5262569
            5 vs 3  |   .1234198   .2644503     0.47   0.641    -.3948933    .6417328
            5 vs 4  |  -.0295976    .245254    -0.12   0.904    -.5102866    .4510914
    ----------------+----------------------------------------------------------------
    4.arm           |
    int_health_down |
            3 vs 2  |   .0270588   .2662534     0.10   0.919    -.4947883    .5489059
            4 vs 2  |   .0166538   .2412676     0.07   0.945    -.4562221    .4895296
            5 vs 2  |   .1909215   .3204776     0.60   0.551     -.437203     .819046
            4 vs 3  |  -.0104051   .1930534    -0.05   0.957    -.3887828    .3679727
            5 vs 3  |   .1638627   .2859466     0.57   0.567    -.3965823    .7243077
            5 vs 4  |   .1742677   .2628395     0.66   0.507    -.3408883    .6894238
    ---------------------------------------------------------------------------------
    Note: dy/dx for factor levels is the discrete change from the base level.
    
    .
    Click image for larger version

Name:	MEsPOISdown.png
Views:	1
Size:	108.4 KB
ID:	1637254
    Last edited by Maxime Bercholz; 19 Nov 2021, 09:54.

    Comment


    • #3
      In #1, -testparm- essentially tests whether treatment effects change monotonically with int_health, while -contrast- simply examines whether treatment effects jointly differ by int_health. -- They are two different things. #2 has more consistent results because they all test, essentially, what -contrast- tests in #1. Other than that, I think the rounding-up may cause differences between #1 and #2. As you only have two underlying indicators for int_health, you are not rounding up, like 3.9 to 4, but 3.5 to 4, which substantially twists original data.

      Comment


      • #4
        Hi Fei and thanks for being willing to read through and respond to my lengthy post! I now realize maybe I should have shortened my post to only the essential parts. I do know that -testparm- and -contrast- are testing different things here; I should have omitted the -testparm- part. I wanted to focus on the -contrast- results from the three Poisson regressions and on the OLS coefficients.

        What I find difficult to explain is why -contrast- after the first Poisson regression (with int_health as continuous) strongly rejects the hypotheses of homogeneous intervention effects across the range of int_health values 1 through 5, while the graphs, pairwise comparisons, OLS interaction coefficients, and -contrast- results after the other two Poisson regressions (with int_health as discrete) all suggest otherwise. I could have shown the corresponding -contrast- results after OLS but I believe lack of significance of the interaction coefficients suffices because, being a linear model, these coefficients are the only way int_health can interact with the interventions (unlike non-linear models like Poisson where marginal effects depend on the values of the other covariates, with or without explicit interaction terms).

        I also think that treating a variable that only takes values 1, 1.5, 2 ... 5 as continuous may be the problem, but I was curious enough about the difference between the Poisson and OLS results when int_health is treated as continuous to write a post. Also, I run into the same difficulties with the other potential moderator of interest, which is constructed from 5 underlying scale variables, giving a wider, albeit still limited, range of values.

        Maxime
        Last edited by Maxime Bercholz; 22 Nov 2021, 08:05.

        Comment


        • #5
          I see your point more clearly now. Thanks for this interpretation.

          First, -contrast- is for joint significance, while graphs and pairwise comparisons are for pairwise tests. The former is more likely to reject the nulls than the latter.

          Second, with identical data and model specification, Poisson and OLS should have little difference in significance of marginal effects as long as original coefficients are small enough. You didn't show -contrast- results for OLS after margins in #1 -- I think the marginal effects should be jointly significant as in Poisson.

          Third, I still think one major source of disparity between #1 and #2 is rounding up or down int_health. You may treat 1, 1.5, 2, ... in #2 as discrete, and significance would be more comparable with #1.
          Last edited by Fei Wang; 22 Nov 2021, 08:40.

          Comment


          • #6
            Thanks for following up! I agree with you on the interpretations of -contrast- and -pwcompare-, but the pairwise comparisons and the graphs clearly show that there is no real evidence of heterogeneous intervention effects. For instance, the first graph shows a flat line for the effect of WLT across the int_health values 1 through 5, so why -contrast- so strongly rejects homogeneity puzzles me. Would you mind elaborating on why -contrast- would be more likely to reject? -pwcompare- does not reject for any pair, so I expected -contrast- not to reject either, or at least I did not expect to see such discrepancies. Ultimately, I think treating int_health as continuous may be the problem, but I'm just not sure why.

            The -contrast- results after OLS are actually the same as the interaction coefficient results (no interactions; see code and results below), so opposite to Poisson. I'm not surprised by that because, in the OLS case, heterogeneous intervention effects across various int_health values is equivalent to non-zero interaction coefficients. In fact, as can be seen from the degrees of freedom, -contrast- only tests one restriction per intervention (which I guess is the restriction that the corresponding interaction coefficient is zero) instead of 4 (whether the intervention effect is the same at int_health = 1 vs. 2, 3, 4 and 5).

            I did try your suggestion, and treating int_health as discrete without rounding (1 = 1, 2 = 1.5, 3 = 2, 4 = 2.5, etc.) in both Poisson and OLS again shows no evidence of heterogeneous intervention effects (the P values are slightly larger in the OLS case but all are large).

            Code:
            . regress redmeat arm##c.int_health
            
                  Source |       SS           df       MS      Number of obs   =     3,490
            -------------+----------------------------------   F(7, 3482)      =     26.58
                   Model |  520.290212         7  74.3271732   Prob > F        =    0.0000
                Residual |  9738.00893     3,482  2.79667115   R-squared       =    0.0507
            -------------+----------------------------------   Adj R-squared   =    0.0488
                   Total |  10258.2991     3,489  2.94018319   Root MSE        =    1.6723
            
            ----------------------------------------------------------------------------------
                     redmeat |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -----------------+----------------------------------------------------------------
                         arm |
                         WL  |    .207299   .3561368     0.58   0.561    -.4909589     .905557
                          T  |  -.6925493   .3646463    -1.90   0.058    -1.407491    .0223929
                        WLT  |  -.8232045   .3700983    -2.22   0.026    -1.548836   -.0975729
                             |
                  int_health |  -.2942289   .0656121    -4.48   0.000    -.4228709   -.1655869
                             |
            arm#c.int_health |
                         WL  |  -.1320273    .091971    -1.44   0.151    -.3123498    .0482952
                          T  |   .0644555   .0944202     0.68   0.495    -.1206691    .2495801
                        WLT  |   .0139352   .0957076     0.15   0.884    -.1737134    .2015838
                             |
                       _cons |   4.630014   .2548842    18.17   0.000     4.130276    5.129752
            ----------------------------------------------------------------------------------
            
            . quietly margins, dydx(arm) at(int_health = (1(1)5)) post
            
            . contrast _at, atequations vsquish
            
            Contrasts of conditional marginal effects       Number of obs     =      3,490
            Model VCE    : OLS
            
            Expression   : Linear prediction, predict()
            dy/dx w.r.t. : 2.arm 3.arm 4.arm
            1._at        : int_health      =           1
            2._at        : int_health      =           2
            3._at        : int_health      =           3
            4._at        : int_health      =           4
            5._at        : int_health      =           5
            
            ------------------------------------------------
                         |         df           F        P>F
            -------------+----------------------------------
            1b.arm       |
                     _at |  (not testable)
            -------------+----------------------------------
            2.arm        |
                     _at |          1        2.06     0.1512
            -------------+----------------------------------
            3.arm        |
                     _at |          1        0.47     0.4949
            -------------+----------------------------------
            4.arm        |
                     _at |          1        0.02     0.8842
                         |
             Denominator |       3482
            ------------------------------------------------
            
            .
            Last edited by Maxime Bercholz; 22 Nov 2021, 13:11.

            Comment


            • #7
              Thanks for the follow-up. Let's focus on the case where int_health is treated as continuous because major discrepancies appear here -- Poisson and OLS are inconsistent, and joint significance and pairwise comparison are inconsistent.

              The poisson model assumes the semi-elasticity effect of treatment changes linearly with int_health, while the OLS assumes the level effect of treatment changes linearly with int_health. After that, -margins, dydx- calculates the level marginal effect and therefore we see consistency between significance of original coefficients and joint significance of marginal effects within OLS. If we run -margins, eydx- after poisson, we'll see similar consistency, as shown in the example below. But if we run -margins, dydx- after poisson, we are showing a different set of marginal effects from the original coefficients, and significance may differ.

              Code:
              . sysuse auto, clear
              (1978 Automobile Data)
              
              . 
              . poisson price foreign##c.rep78, vce(robust)
              
              Iteration 0:   log pseudolikelihood = -39738.322  
              Iteration 1:   log pseudolikelihood = -39738.322  
              
              Poisson regression                              Number of obs     =         69
                                                              Wald chi2(3)      =       1.03
                                                              Prob > chi2       =     0.7949
              Log pseudolikelihood = -39738.322               Pseudo R2         =     0.0073
              
              ---------------------------------------------------------------------------------
                              |               Robust
                        price |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ----------------+----------------------------------------------------------------
                      foreign |
                     Foreign  |  -.4551757   .4751735    -0.96   0.338    -1.386499    .4761472
                        rep78 |  -.0119035    .063681    -0.19   0.852    -.1367159     .112909
                              |
              foreign#c.rep78 |
                     Foreign  |   .1050844   .1211451     0.87   0.386    -.1323557    .3425244
                              |
                        _cons |   8.764862   .2233971    39.23   0.000     8.327012    9.202712
              ---------------------------------------------------------------------------------
              
              . margins, eydx(foreign) at(rep78 = (1(1)5)) post vsquish
              
              Conditional marginal effects                    Number of obs     =         69
              Model VCE    : Robust
              
              Expression   : Predicted number of events, predict()
              ey/dx w.r.t. : 1.foreign
              1._at        : rep78           =           1
              2._at        : rep78           =           2
              3._at        : rep78           =           3
              4._at        : rep78           =           4
              5._at        : rep78           =           5
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |      ey/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
              0.foreign    |  (base outcome)
              -------------+----------------------------------------------------------------
              1.foreign    |
                       _at |
                        1  |  -.3500913   .3581657    -0.98   0.328    -1.052083    .3519006
                        2  |  -.2450069   .2452098    -1.00   0.318    -.7256092    .2355953
                        3  |  -.1399226   .1460316    -0.96   0.338    -.4261393    .1462942
                        4  |  -.0348382   .1089722    -0.32   0.749    -.2484198    .1787434
                        5  |   .0702461   .1782608     0.39   0.694    -.2791387    .4196309
              ------------------------------------------------------------------------------
              Note: ey/dx for factor levels is the discrete change from the base level.
              
              . contrast _at, atequations vsquish
              
              Contrasts of conditional marginal effects       Number of obs     =         69
              Model VCE    : Robust
              
              Expression   : Predicted number of events, predict()
              ey/dx w.r.t. : 1.foreign
              1._at        : rep78           =           1
              2._at        : rep78           =           2
              3._at        : rep78           =           3
              4._at        : rep78           =           4
              5._at        : rep78           =           5
              
              ------------------------------------------------
                           |         df        chi2     P>chi2
              -------------+----------------------------------
              0b.foreign   |
                       _at |  (omitted)
              -------------+----------------------------------
              1.foreign    |
                       _at |          1        0.75     0.3857
              ------------------------------------------------
              
              . 
              . quietly poisson price foreign##c.rep78, vce(robust)
              
              . margins, dydx(foreign) at(rep78 = (1(1)5)) post vsquish
              
              Conditional marginal effects                    Number of obs     =         69
              Model VCE    : Robust
              
              Expression   : Predicted number of events, predict()
              dy/dx w.r.t. : 1.foreign
              1._at        : rep78           =           1
              2._at        : rep78           =           2
              3._at        : rep78           =           3
              4._at        : rep78           =           4
              5._at        : rep78           =           5
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
              0.foreign    |  (base outcome)
              -------------+----------------------------------------------------------------
              1.foreign    |
                       _at |
                        1  |   -1869.55   1759.643    -1.06   0.288    -5318.386    1579.286
                        2  |  -1359.106   1275.202    -1.07   0.287    -3858.457    1140.245
                        3  |  -807.0131   816.9697    -0.99   0.323    -2408.244    794.2182
                        4  |  -209.1056   656.2292    -0.32   0.750    -1495.291     1077.08
                        5  |   439.1861   1114.091     0.39   0.693    -1744.392    2622.764
              ------------------------------------------------------------------------------
              Note: dy/dx for factor levels is the discrete change from the base level.
              
              . contrast _at, atequations vsquish
              
              Contrasts of conditional marginal effects       Number of obs     =         69
              Model VCE    : Robust
              
              Expression   : Predicted number of events, predict()
              dy/dx w.r.t. : 1.foreign
              1._at        : rep78           =           1
              2._at        : rep78           =           2
              3._at        : rep78           =           3
              4._at        : rep78           =           4
              5._at        : rep78           =           5
              
              ------------------------------------------------
                           |         df        chi2     P>chi2
              -------------+----------------------------------
              0b.foreign   |
                       _at |  (omitted)
              -------------+----------------------------------
              1.foreign    |
                       _at |          3      220.68     0.0000
              ------------------------------------------------

              Comment


              • #8
                As for the different results between -contrast- and -pwcompare- (and pairwise comparison in a graph), it's essentially a classic inconsistency between a joint F test and multiple single t tests. There are many potential reasons for such inconsistency. For example, multi-collinear regressors may be insignificant in single t tests but are jointly significant in an F test. Moreover, when we reject the null in an F test, we do it with abundant confidence. But when we fail to reject the null in a t test, we are not that confident as the type-II error could be very large. -- From this perspective, we are not even able to treat significant F and insignificant ts as completely inconsistent.

                Comment


                • #9
                  Hi Fei,

                  I did not think of -margins, eydx-, thanks for bringing it up. However, while I follow your argument I don't think I should pay attention to the Poisson coefficients directly, so discrepancies between them and -contrast- after -margins, dydx- are not an issue, or at least from how I see it. The level effects are really what I am interested in, and specifically whether they differ across values of int_health, so -margins, dydx- is what I need to use and pay attention to.

                  Thanks for refreshing my memory on why joint significance tests and individual pairwise comparison tests might differ; perhaps I ought not to be too surprised by inconsistency in the test results. Yet, I still find that explanation difficult to accept when I see the point estimates and CIs on the plot below (copied from #1). Of particular interest are the effects of WLT across the int_health values 1 through 5: the line connecting them is basically flat. Not only that, the chi2 statistic from -contrast _at, atequation- is the highest for WLT, despite its having the least varying effect.

                  I appreciate your time helping me to figure this out, but I know we all our own work to get done so I would not take it badly if you had other things to do than follow up on this lengthy thread!

                  Click image for larger version

Name:	image_24764.png
Views:	2
Size:	110.1 KB
ID:	1637791

                  Comment

                  Working...
                  X