Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Random effects logistic regression: -metan- v -xtlogit-


From   Roger Harbord <[email protected]>
To   [email protected]
Subject   Re: st: Random effects logistic regression: -metan- v -xtlogit-
Date   Wed, 06 Dec 2006 07:24:00 +0000

This suggests the discrepancy is due to different between-study
variances for the two comparisons. In -metan- you're fitting each
comparison separately with its own between-study variance. In -xtlogit-
Paul Pharoah was fitting it all in a single model with a single
between-study variance for both comparisons.

Roger.

Paul Seed wrote:
> I tried repeating Paul Pharoah's analysis & got
> essentially the same answers
> However, the problem only arises when fitting both alleles at once.
> If I use
>         xtlogit case  allele2 if  allele0|  allele2, or
> I get
> -------------------------------------------------------------------------=
-----
>
>         case |         OR   Std. Err.      z    P>|z|     [95% Conf.
> Interval]
> -------------+-----------------------------------------------------------=
-----
>
>      allele2 |   1.011836   .0798964     0.15   0.882     .8667581
> 1.181198
> -------------+-----------------------------------------------------------=
-----
>
>     /lnsig2u |  -4.015044    .701948                     -5.390836
> -2.639251
> -------------+-----------------------------------------------------------=
-----
>
>      sigma_u |   .1343211   .0471432                      .0675141
> .2672354
>          rho |   .0054542   .0038077                      .0013836
> .0212463
> -------------------------------------------------------------------------=
-----
>
> Likelihood-ratio test of rho=3D0: chibar2(01) =3D  4557.62 Prob >=3D chib=
ar2
> =3D 0.000
>
> This is very similar to -metan- & to -cc-
>
> cc  case  allele2 if  allele0|  allele2, by(st)
>
>
>            study |       OR       [95% Conf. Interval]   M-H Weight
> -----------------+-------------------------------------------------
>                1 |   1.543568      .8175427   2.976996     8.822736
> (exact)
>                2 |   1.965573      1.073019    3.67396     8.657382
> (exact)
>                3 |   .7776123      .5184206   1.163567     29.46082
> (exact)
>                4 |   1.244903      .8505777   1.824859     25.93921
> (exact)
>                5 |   .9165455      .6630693   1.263553     41.88866
> (exact)
>                6 |   .8405524      .6093421   1.159476     43.69371
> (exact)
>                7 |   .9585875      .7257767   1.269623     53.53306
> (exact)
>                8 |   1.038503      .8535848   1.263426     102.7595
> (exact)
>                9 |   .9407818      .7907902   1.119215     137.0404
> (exact)
> -----------------+-------------------------------------------------
>            Crude |   .9884827      .9012316   1.084181
> (exact)
>     M-H combined |   .9914067      .9038977   1.087388
> -------------------------------------------------------------------
> Test of homogeneity (M-H)      chi2(8) =3D    12.59  Pr>chi2 =3D 0.1268
>
>                    Test that combined OR =3D 1:
>                                 Mantel-Haenszel chi2(1) =3D      0.03
>                                                 Pr>chi2 =3D    0.8548
>
>
>
>> Date: Fri, 1 Dec 2006 09:50:44 -0000
>> From: "Paul Pharoah" <[email protected]>
>> Subject: st: Random effects logistic regression: -metan- v -xtlogit-
>>
>> multiple case-control studies differ (substantially) between metan-
>> and =ADxtlogit- ?
>>
>> Data are from nine unmatched cases control studies of SNP genotype
>>
>> study =AD study variable
>> gene00  RR genotype frequency in controls
>> gene01  RQ genotype frequency in controls
>> gene02  QQ genotype frequency in controls
>> gene10  RR genotype frequency in cases
>> gene11  RQ genotype frequency in cases
>> gene12  QQ genotype frequency in cases
>>
>> study   gene00  gene01  gene02  gene10  gene11  gene12
>> 1       228     141     19      241     188     31
>> 2       149     144     21      148     119     41
>> 3       252     299     74      254     290     58
>> 4       256     274     68      251     251     83
>> 5       425     499     127     314     307     86
>> 6       309     353     108     354     350     104
>> 7       328     391     109     609     669     194
>> 8       947     1030    313     740     875     254
>> 9       1054    1173    360     1083    1268    348
>>
>> The following command generates the random effects pooled OR for QQ
>> vs RR
>> genotype
>>
>> . metan  gene00 gene02 gene10 gene12, random or
>>
>>            Study |       OR   [95% Conf. Interval]    % Weight
>> -
>> -----------------+------------------------------------------------------=
-
>>
>> 1                |  1.54357     .847914   2.80996      3.92373
>> 2                |  1.96557     1.10822   3.48619       4.2419
>> 3                |  .777612      .52893   1.14322      8.12115
>> 4                |   1.2449     .864373   1.79296      8.81242
>> 5                |  .916545     .672142   1.24982      11.0651
>> 6                |  .840552      .61681   1.14546      11.0958
>> 7                |  .958588     .731544    1.2561      13.1761
>> 8                |   1.0385     .857574    1.2576      18.8354
>> 9                |  .940782     .793702   1.11512      20.7284
>> -
>> -----------------+------------------------------------------------------=
-
>>
>>   D+L pooled OR  |  1.00456     .885302   1.13988
>> -
>> -----------------+------------------------------------------------------=
-
>>
>>   Heterogeneity chi-squared =3D  12.59 (d.f. =3D 8) p =3D 0.127
>>   Estimate of between-study variance Tau-squared =3D  0.0125
>>   Test of OR=3D1 : z=3D 0.07 p =3D 0.944
>>
>>
>> And, the RQ vs RR random effects pooled OR
>>
>> . metan  gene00 gene01 gene10 gene11, random or
>>
>>            Study |       OR   [95% Conf. Interval]    % Weight
>> -
>> -----------------+------------------------------------------------------=
-
>>
>> 1                |  1.26141     .949866   1.67514      6.51369
>> 2                |  .831973     .596507   1.16039      4.98645
>> 3                |  .962263     .758749   1.22036      8.60693
>> 4                |  .934307     .731869   1.19274      8.25621
>> 5                |  .832716     .679269   1.02083      10.7657
>> 6                |  .865463     .699804   1.07034      10.1444
>> 7                |  .921522     .767211   1.10687      12.4064
>> 8                |  1.08715     .952918   1.24029      18.0585
>> 9                |  1.05204     .936656   1.18164      20.2618
>> -
>> -----------------+------------------------------------------------------=
-
>>
>>   D+L pooled OR  |  .978139     .902773    1.0598
>> -
>> -----------------+------------------------------------------------------=
-
>>
>>   Heterogeneity chi-squared =3D  12.01 (d.f. =3D 8) p =3D 0.151
>>   Estimate of between-study variance Tau-squared =3D  0.0047
>>   Test of OR=3D1 : z=3D 0.54 p =3D 0.589
>>
>>
>> If the data are reshaped from wide into long using the following
>> series of
>> commands
>>
>> . reshape long gene0 gene1 gene2, i(study) j(case)
>> . reshape long weight ,  i(study case)  j(alleles)
>> . expand weight
>>
>> The fixed effects pooled genotype specific effects obtained by logistic
>> regression are the same as the fixed effects from =ADmetan-.  I.e.
>>
>> . xi: logistic case i.alleles, nolog
>>
>> i.alleles         _Ialleles_0-2       (naturally coded; _Ialleles_0
>> omitted)
>>
>> Logistic regression                               Number of obs   =3D
>> 18961
>>                                                   LR chi2(2)      =3D
>> 0.10
>>                                                   Prob > chi2     =3D
>> 0.9501
>> Log likelihood =3D -13142.621                       Pseudo R2       =3D
>> 0.0000
>>
>> -
>> ------------------------------------------------------------------------=
----
>>
>> - --
>>         case | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf.
>> Interval]
>> -
>> -------------+----------------------------------------------------------=
----
>>
>> - --
>>  _Ialleles_1 |   .9914684   .0308417    -0.28   0.783     .9328256
>> 1.053798
>>  _Ialleles_2 |   .9884827    .046065    -0.25   0.804     .9021974
>> 1.08302
>> -
>> ------------------------------------------------------------------------=
----
>>
>> - --
>>
>>
>> But, the random effects estimates using xtlogit and study as the panel
>> variable are very different and clearly wrong.
>>
>> . xi: xtlogit case i.alleles , i(study) re or
>> i.alleles         _Ialleles_0-2       (naturally coded; _Ialleles_0
>> omitted)
>>
>> Fitting comparison model:
>>
>> Iteration 0:   log likelihood =3D -13142.672
>> Iteration 1:   log likelihood =3D -13142.621
>>
>> Fitting full model:
>>
>> tau =3D  0.0     log likelihood =3D -5971.0991
>> tau =3D  0.1     log likelihood =3D -5971.4368
>>
>> Random-effects logistic regression              Number of obs      =3D
>> 18961
>> Group variable (i): study                       Number of groups   =3D
>> 9
>>
>> Random effects u_i ~ Gaussian                   Obs per group: min =3D
>> 622
>>                                                                avg =3D
>> 2106.8
>>                                                                max =3D
>> 5286
>>
>>                                                 Wald chi2(2)       =3D
>> 7.45
>> Log likelihood  =3D -5965.7258                    Prob > chi2        =3D
>> 0.0242
>>
>> -
>> ------------------------------------------------------------------------=
----
>>
>> - --
>>         case |         OR   Std. Err.      z    P>|z|     [95% Conf.
>> Interval]
>> -
>> -------------+----------------------------------------------------------=
----
>>
>> - --
>>  _Ialleles_1 |   1.050559   .1153838     0.45   0.653     .8470957
>> 1.302893
>>  _Ialleles_2 |   1.778091   .3759296     2.72   0.006     1.174871
>> 2.691025
>> -
>> -------------+----------------------------------------------------------=
----
>>
>> - --
>>     /lnsig2u |  -5.132952
>> 1.966205                     -8.986643   -1.279262
>> -
>> -------------+----------------------------------------------------------=
----
>>
>> - --
>>      sigma_u |   .0768057   .0755079                      .0111834
>> .527487
>>          rho |   .0017899    .003513                       .000038
>> .0779804
>> -
>> ------------------------------------------------------------------------=
----
>>
>> - --
>> Likelihood-ratio test of rho=3D0: chibar2(01) =3D  1.4e+04 Prob >=3D chi=
bar2 =3D
>> 0.000
>>
>> The QQ vs RR OR is bigger than all but one of the study specific ORs,
>> so is
>> clearly wrong.
>>
>> So
>>                      Metan        xtlogit
>>
>> Pooled OR RQ vs RR   0.98         1.05
>>
>> Pooled OR QQ vs RR   1.00         1.74
>>
>> Any ideas?
>>
>> Many thanks
>>
>> Paul Pharoah

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index