Statalist


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

st: RE: random-effects SROC model in gllamm


From   "Ben Dwamena" <bdwamena@med.umich.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: random-effects SROC model in gllamm
Date   Sun, 16 Dec 2007 18:52:20 -0500

Dear Jay, 
Thanks. However, the code you provide allows modeling the generic bivariate random-effects model for multiple 2 by 2 table which have implemented in midas ( ssc install  midas). In that case you could avoid expanding by using bin(count) to convert binary to binomial regression.

My question is related to an exact binomial equivalent of the following gaussian model:
*logit transformation of sensitivity and specificity
gen float lno0=logit(tp/(tp+fn))
gen float lno1=logit(fp/(tn+fp))
gen ds1=lno0-lno1
gen ds0=lno0+lno1

reshape long ds, i(study) j(dtruth)
tabulate dtruth, generate(disgrp)
eq het: disgrp1 disgrp2
eq disgrp1: disgrp1
eq disgrp2: disgrp2

gllamm ds disgrp1 disgrp2, nocons i(study) nrf(2) eqs(disgrp1 disgrp2) ///
s(het)  adapt  ip(m) trace

Ben


Ben Adarkwa Dwamena, MD

Assistant Professor of  Radiology
Division of Nuclear Medicine
Department of Radiology
University of Michigan Health Systems
B1G505 UH SPC 5028
1500 E. Medical Center Drive
Ann Arbor, MI  48109-5028


bdwamena@umich.edu

http://sitemaker.umich.edu/metadiagnosis



Staff Physician
D748 Nuclear Medicine Service (115), 
VA Ann Arbor Health Care System
2215 Fuller Road
Ann Arbor, MI 48105
734-845-3775 Phone
734-845-3252 Fax



>>> "Verkuilen, Jay" <JVerkuilen@gc.cuny.edu> 12/16/2007 1:25 PM >>>
>>I would appreciate assistance with a gllamm or xtmelogit code for the model described below for combining multiple 2 by 2 results of a binary diagnostic test with binary reference test outcome:<<<

Coincidentally I set up something like this for my students in categorical data analysis recently. (They had to consider the output since the copy of Stata they have can't actually run this model.) Not sure if it's exactly what you want, but here it is. Uses the classic "betablocker" dataset (see below for plain text of it), modeling the probability of death. This study has 22 2X2 tables. 

i indexes study (1... 22)
betablocker_i = 1 for treatment group and 0 for controls

logit(mu_i) = alpha_i0 + alpha_i1*(betablocker_i) 

alpha_i0 = alpha_0 + u_i0
alpha_i1 = alpha_1 + u_i1

The u terms are unstructured MVN with mean 0. (It turns out for these data you can restrict things further and here really only need the random intercept.) Hopefully I didn't hatchet the notation here. 

This code fits the above model:

     xtmelogit death betablocker, || study: betablocker, covariance(unstructured)


I had the data in long form already from Stata 9.2, and didn't rearrange things to use binomial processing, which would definitely be more efficient, though this only takes thirty seconds or so on my Macbook running Stata SE. <shrug> SAS nlmixed lets you use weights, and is therefore quicker. I didn't try GLLAMM. 


//need to run expand count on this first since xtmelogit doesn't like frequency weights. 

study	betablocker	death	count
1	0	0	36
1	0	1	3
1	1	0	35
1	1	1	3
2	0	0	102
2	0	1	14
2	1	0	107
2	1	1	7
3	0	0	82
3	0	1	11
3	1	0	64
3	1	1	5
4	0	0	1393
4	0	1	127
4	1	0	1431
4	1	1	102
5	0	0	338
5	0	1	27
5	1	0	327
5	1	1	28
6	0	0	46
6	0	1	6
6	1	0	55
6	1	1	4
7	0	0	787
7	0	1	152
7	1	0	847
7	1	1	98
8	0	0	423
8	0	1	48
8	1	0	572
8	1	1	60
9	0	0	245
9	0	1	37
9	1	0	253
9	1	1	25
10	0	0	1733
10	0	1	188
10	1	0	1778
10	1	1	138
11	0	0	531
11	0	1	52
11	1	0	809
11	1	1	64
12	0	0	219
12	0	1	47
12	1	0	218
12	1	1	45
13	0	0	277
13	0	1	16
13	1	0	282
13	1	1	9
14	0	0	838
14	0	1	45
14	1	0	801
14	1	1	57
15	0	0	116
15	0	1	31
15	1	0	129
15	1	1	25
16	0	0	175
16	0	1	38
16	1	0	174
16	1	1	33
17	0	0	110
17	0	1	12
17	1	0	223
17	1	1	28
18	0	0	148
18	0	1	6
18	1	0	143
18	1	1	8
19	0	0	131
19	0	1	3
19	1	0	168
19	1	1	6
20	0	0	178
20	0	1	40
20	1	0	177
20	1	1	32
21	0	0	321
21	0	1	43
21	1	0	364
21	1	1	27
22	0	0	635
22	0	1	39
22	1	0	658
22	1	1	22

**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues

*
*   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–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index