Dear Martin, Tirthankar and stalisters,
Thank you for your help and impressive rapid responses.
It seems as though the variable estimates from GLST arise because the
estimation procedure does not totally ignore data rows other than those
selected by collecc=1 when using the 'if' command.
I had wrongly expected that the error would arise within the selected data
(if collecc==1), but learned that the variable estimates arise only when the
other rows are also present.
The data below generates the variable estimates.
****************************************************************************
*******
clear
input ln_rr_m dosage collecc se_glst person_y case study_id study_e
0 0 0 0 . 127 1 1
.1310282 1.303519 0 .1262702 . 136 1 1
-.0512933 2.506768 0 .1372102 . 102 1 1
-.0943106 4.311642 0 .1411723 . 95 1 1
-.356675 7.720846 0 .1613608 . 93 1 1
0 0 0 0 . 210 2 2
.0099503 1.01444 0 .1003446 . 213 2 2
-.1625189 1.916164 0 .1046663 . 183 2 2
-.4780358 3.26875 0 .1085392 . 169 2 2
-.328504 6.199353 0 .1120854 . 140 2 2
0 0 1 0 39637 281 3 2
-.0725707 1.330824 1 .0900071 40218 265 3 2
-.1278334 2.439844 1 .0927315 40621 241 3 2
-.2613648 4.103374 1 .0993551 40956 198 3 2
-.4462871 7.430433 1 .1018274 41222 156 3 2
0 0 1 0 145258 219 7 2
-.1625189 1.212121 1 .1071075 141933 162 7 2
-.1392621 2.203856 1 .1142941 139945 151 7 2
-.198451 3.636364 1 .1199011 146011 132 7 2
-.4462871 7.493112 1 .1487646 143153 77 7 2
0 0 1 0 34750 204 8 2
-.1508229 2.187076 1 .105855 35154 164 8 2
-.0618754 3.827383 1 .1078736 35196 172 8 2
-.1625189 5.649946 1 .1132499 35488 156 8 2
-.328504 9.112817 1 .1294023 35529 148 8 2
0 0 1 0 23988 456 9 2
-.0943106 1.14482 1 .0758309 25050 381 9 2
-.1165338 2.289639 1 .0800162 24227 357 9 2
-.1863296 3.663423 1 .03712 26115 386 9 2
0 0 2 0 . . 1 2
.0099503 1.604332 2 .1446727 . . 1 2
-.1165338 2.607039 2 .1465412 . . 1 2
.1310282 4.1111 2 .1436079 . . 1 2
.0099503 7.119222 2 .1484521 . . 1 2
end
compress
list, noobs // in 1/35 sepby(id)
forv i=1/10{
glst ln_rr_m dosage if collecc==1 , se(se_glst) cov(person_y case)
///
pfirst(study_id study_e) random
}
****************************************************************************
*******
The above although giving variable estimates seems to progress without
crashing to a halt. When these data are present among the larger dataset
comprising 132 rows of data then repeating the GLST command (as per your
'forv i=1/10' statement) can sometimes bring the operation to a halt (as
well as giving variable estimates) with the following error messages (again
suggesting the GLST command is not totally ignoring the data rows outside
the selection):
*: 3200 conformability error
glsest(): - function returned error
<istmt>: - function returned error
r(3200);
It seems I can get by using the 'keep' or 'drop' command to select the data,
but would regret the loss of ability to use 'if' for data selection.
Additionally, it seems there is always the potential that users not
selecting via keep or drop might similarly risk inaccurate estimates should
the GLST command be run once only.
Help with avoiding this problem when using 'if' would be much appreciated.
With thanks
Geoff. L.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: 07 May 2009 16:32
To: [email protected]
Subject: st: AW: Variable estimates from GLST metaregression of
observational studies
<>
-glst- can be located via -findit glst-, you should add. How do the results
differ? Mine are constant across ten repetitions...
*************
clear*
input ln_rr_m dosage collecc se_glst person_y case study_id study_e
0 0 1 0 39637 281 3 2
-.0725707 1.330824 1 .09000712 40218 265 3 2
-.1278334 2.439844 1 .09273151 40621 241 3 2
-.2613648 4.103374 1 .09935509 40956 198 3 2
-.4462871 7.430433 1 .10182739 41222 156 3 2
0 0 1 0 145258 219 7 2
-.1625189 1.212121 1 .10710753 141933 162 7 2
-.1392621 2.203856 1 .11429413 139945 151 7 2
-.198451 3.636364 1 .11990109 146011 132 7 2
-.4462871 7.493112 1 .14876455 143153 77 7 2
0 0 1 0 34750 204 8 2
-.1508229 2.187076 1 .10585496 35154 164 8 2
-.0618754 3.827383 1 .10787362 35196 172 8 2
-.1625189 5.649946 1 .11324987 35488 156 8 2
-.328504 9.112817 1 .12940233 35529 148 8 2
0 0 1 0 23988 456 9 2
-.0943106 1.14482 1 .07583086 25050 381 9 2
-.1165338 2.289639 1 .08001615 24227 357 9 2
-.1863296 3.663423 1 .03711996 26115 386 9 2
end
compress
list, noobs // in 1/20 sepby(id)
forv i=1/10{
glst ln_rr_m dosage if collecc==1, se(se_glst) cov(person_y case)
///
pfirst(study_id study_e) random
}
*************
Output:
Random-effects dose-response model Number of studies =
4
Iterative Generalized least-squares regression Number of obs =
15
Goodness-of-fit chi2(14) = 6.14 Model chi2(1) =
60.91
Prob > chi2 = 0.9628 Prob > chi2 =
0.0000
----------------------------------------------------------------------------
--
ln_rr_m | Coef. Std. Err. z P>|z| [95% Conf.
Interval]
-------------+----------------------------------------------------------
-------------+----
--
dosage | -.0484551 .0062085 -7.80 0.000 -.0606236
-.0362866
----------------------------------------------------------------------------
--
Moment-based estimate of between-study variance of the slope: tau2 = 0.0e+00
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von G Livesey
Gesendet: Donnerstag, 7. Mai 2009 17:20
An: [email protected]; [email protected]
Betreff: st: Variable estimates from GLST metaregression of observational
studies
Dear Nicola and Statalisters,
I am getting different estimates each time I run a glst command on the same
dataset in Stata and would be glad of suggestions of how to resolve the
problem.
The glst command is used here to estimate the dose-dependency of effect in
observational or relative risk data.
The command and syntax, and extract from a dataset in use are shown below.
I am using Stata v9.2, an up-to-date version of glst and the log data
(ln_rr_m and corresponding errors se_glst) were obtained with gen double.
I would very much appreciate help with this crucial problem.
With thanks,
Geoff. Livesey
COMMAND AND SYNTAX:
glst ln_rr_m dosage if collect_c==1, se(se_glst) cov(person_y case)
pfirst(study_id studyexpression) random
DATA:
ln_rr_m dosage collec~c se_glst person_y case study_id study_e
0 0 1 0 39637 281 3 2
-.0725707 1.330824 1 .09000712 40218 265 3 2
-.1278334 2.439844 1 .09273151 40621 241 3 2
-.2613648 4.103374 1 .09935509 40956 198 3 2
-.4462871 7.430433 1 .10182739 41222 156 3 2
0 0 1 0 145258 219 7 2
-.1625189 1.212121 1 .10710753 141933 162 7 2
-.1392621 2.203856 1 .11429413 139945 151 7 2
-.198451 3.636364 1 .11990109 146011 132 7 2
-.4462871 7.493112 1 .14876455 143153 77 7 2
0 0 1 0 34750 204 8 2
-.1508229 2.187076 1 .10585496 35154 164 8 2
-.0618754 3.827383 1 .10787362 35196 172 8 2
-.1625189 5.649946 1 .11324987 35488 156 8 2
-.328504 9.112817 1 .12940233 35529 148 8 2
0 0 1 0 23988 456 9 2
-.0943106 1.14482 1 .07583086 25050 381 9 2
-.1165338 2.289639 1 .08001615 24227 357 9 2
-.1863296 3.663423 1 .03711996 26115 386 9 2
*
* 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/
*
* 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/
*
* 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/