gertvv / gemtc

GeMTC R package: model generation for network meta-analysis
GNU General Public License v3.0
44 stars 27 forks source link

Nodesplitting with contrast data fails #46

Closed DanielReid closed 6 years ago

DanielReid commented 7 years ago

the following model params lead to an error:

{
 "network": {
 "description": "Network",
"treatments": {
 "id": [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" ],
"description": [ "5-FU", "Acyc+5-FU", "Acyc+D", "Acyc+Eto+Cis+5-FU", "C+RT", "Cis+5-FU", "Dtx+5-FU", "Dtx+Cis", "Dtx+IRI+Cis+5-FU", "MMC", "MMC+5-FU", "MMC+Cis+5-FU", "Obs", "Ox+5-FU", "Ox+5-FU(prolong)" ] 
},
"data.re": {
 "study": [ "Bajetta2002", "Bajetta2002", "Bajetta2014", "Bajetta2014", "Bamias2010", "Bamias2010", "Bang2012", "Bang2012", "Bartolomeo2006", "Bartolomeo2006", "Bouche2005", "Bouche2005", "Cascinu2007", "Cascinu2007", "Chipponi2004", "Chipponi2004", "Cirera1999", "Cirera1999", "Coombes1990", "Coombes1990", "Devita2007", "Devita2007", "Dicostanzo2008", "Dicostanzo2008", "Feng2015", "Feng2015", "Grau1993", "Grau1993", "Grau1998", "Grau1998", "Kang2013", "Kang2013", "Kim1992", "Kim1992", "Kim2012", "Kim2012", "Krook1991", "Krook1991", "Kulig2010", "Kulig2010", "Kwon2010", "Kwon2010", "Lee2004", "Lee2004", "Lee2012", "Lee2012", "Lee2016", "Lee2016", "Lise1995", "Lise1995", "Macdonald2001", "Macdonald2001", "Nakajima2007", "Nakajima2007", "Neri2001", "Neri2001", "Sakuramoto2007", "Sakuramoto2007", "Shimoyama1999", "Shimoyama1999", "Tentes2006", "Tentes2006", "Tsavaris1996", "Tsavaris1996", "Yu2012", "Yu2012", "Zhang2011", "Zhang2011", "Zhu2012", "Zhu2012", "Chang2002", "Chang2002", "Chang2002", "Tsujinaka2000", "Tsujinaka2000", "Tsujinaka2000" ],
"treatment": [ "13", "4", "1", "9", "8", "5", "13", "14", "10", "9", "13", "6", "1", "3", "13", "6", "13", "11", "13", "3", "13", "3", "13", "3", "14", "15", "13", "10", "10", "11", "11", "12", "13", "11", "1", "5", "13", "2", "13", "3", "6", "5", "1", "3", "6", "5", "6", "7", "13", "3", "5", "13", "13", "1", "2", "13", "13", "1", "6", "12", "13", "3", "13", "3", "1", "5", "1", "14", "5", "1", "1", "3", "11", "1", "2", "11" ],
"diff": [ null, -0.0726, null, -0.0165, null, 0.1797, null, -0.4179, null, -0.1992, null, -0.3011, null, -0.051, null, -0.0582, null, -0.5071, null, -0.162, null, -0.0902, null, -0.10762, null, -0.3531, null, -0.427, null, -0.33373, null, 0.1064, null, -0.2297, null, -0.1349, null, 0.0343, null, -0.1177, null, -0.1046, null, 0.0328, null,  0.122, null, 0.1821, null, -0.1576, null, 0.2827, null, -0.7318, null, 0.6746, null, -0.4013, null, -0.4548, null, -0.0515, null, -0.5558, null, -0.6468, null, -0.0714, null, 0.2194, null, 0.4087, 0.3583, null, -0.3381, 0.5106 ],
"std.err": [ null, 0.1828, null, 0.0929, null, 0.2385, null, 0.1303, null, 0.2858, null, 0.1608, null,  0.156, null, 0.5391, null, 0.2217, null,  0.145, null, 0.1433, null, 0.1728, null, 0.1982, null, 0.2127, null, 0.32501, null, 0.1137, null, 0.1667, null, 0.3274, null, 0.1995, null, 0.1397, null,  0.427, null, 0.4954, null, 0.1923, null, 0.2684, null, 0.1473, null, 0.0956, null, 0.3139, null, 0.2025, null, 0.1097, null, 0.9994, null, 0.6019, null,  0.252, null,   0.52, null, 0.4612, null, 0.1435, 0.2399, 0.3052, 0.3008, 0.32527, 0.4493, 0.5846 ] 
},
"studies": {
 "study": [ "Bajetta2002", "Bajetta2014", "Bamias2010", "Bang2012", "Bartolomeo2006", "Bouche2005", "Cascinu2007", "Chang2002", "Chipponi2004", "Cirera1999", "Coombes1990", "Devita2007", "Dicostanzo2008", "Feng2015", "Grau1993", "Grau1998", "Kang2013", "Kim1992", "Kim2012", "Krook1991", "Kulig2010", "Kwon2010", "Lee2004", "Lee2012", "Lee2016", "Lise1995", "Macdonald2001", "Nakajima2007", "Neri2001", "Sakuramoto2007", "Shimoyama1999", "Tentes2006", "Tsavaris1996", "Tsujinaka2000", "Yu2012", "Zhang2011", "Zhu2012" ] 
} 
},
"linearModel": "random",
"likelihood": "normal",
"link": "identity",
"type": "nodesplit",
"t1":      1,
"t2":      2 
}

The cause seems to be that nodesplit.rewrite.studies returns a dataframe with no colnames, where subsequent code expects a 'study' colname to exist. Adding a line colnames(studies) = "study" near the end seems to fix things but it's probably a good idea to check that function more thoroughly because we think line 53 should always throw an error, given that the rbind operation does not make a list.

cvann1986 commented 5 years ago

Hello, I'm trying to run the mtc.nodesplit function with a network containing both arm-level and relative effect data. The following error occurs: Error in [.default(studies, ma) : invalid subscript type 'list'. Could you please advise? Thank you.