gertvv / gemtc

GeMTC R package: model generation for network meta-analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Understand error from mtc.model for meta-regression

richardz99 opened this issue · comments

Hello,

I'm getting the error:

Error in studyData[[regressor[["variable"]]]] : subscript out of bounds

when I try and run mtc.model on a meta-regression. Any idea what could be causing the error?

My network looks something like this:

MTC dataset: Network
Arm-level data: 
   study    treatment  mean std.err
1   1683   A              -1.95   0.170
2   1683   B              -2.22   0.160
3   1683   C              -1.14   0.160
4   1683   D              -1.74   0.160
5   1711    A              -1.05   0.096
6   1711    D              -1.19   0.086
7   3636   C              -1.14   0.124
8   3636    D              -1.76   0.087

Study-level data: 
      study     base
 [1,]  1683 1.780000
 [2,]  1711 1.260000
 [3,]  3636 0.750000

But there are 22 studies, 13 treatments, and 69 data points

I'm trying to set a regressor with

regressor <- list(coefficient='shared', variable='base', control="A")

and then the model with

model.created <- mtc.model(network.created, type = "regression", likelihood = "normal", link = "identity", regressor = regressor, linearModel = modeltype, dic = TRUE)

Thank you,
Richard

Hello Richard,

I think the problem here is that your study-level data is a matrix, not a data frame. I should add a check or a conversion for that. For now, you can do the conversion yourself and it should work.

Gert

Hello Gert,

It worked. Thank you very much.

Richard

This is now fixed and such problems will be detected by gemtc in the next release.