Netmeta in R
1
0
Entering edit mode
5.6 years ago
ren • 0

This is my database:

id<-c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,15,16,16,17,17,18,18,19,19,19,20,20,21,21)
r<-c(71,57,68,53,53,17,25,5,58,9,34,12,17,3,27,1,43,12,32,10,40,25,24,19,16,8,35,57,6,5,5,25,15,11,16,37,9,80,58,101,41,21,48,49)
n<-c(331,329,215,209,218,73,65,25,225,74,159,166,67,23,83,25,127,58,220,148,209,207,33,30,21,21,59,77,26,32,26,36,22,15,18,94,47,169,170,169,57,56,63,63)
t<-c("certolizumab","Placebo","certolizumab","Placebo","certolizumab","Placebo","adalimumab","Placebo","adalimumab","Placebo","adalimumab","Placebo","infliximab","Placebo","vedolizumab","Placebo","vedolizumab","Placebo","vedolizumab","Placebo","aziothioprine/6MP","Placebo","aziothioprine/6MP","Placebo","aziothioprine/6MP","Placebo","Placebo","aziothioprine/6MP","methotrexate","aziothioprine/6MP","Placebo","methotrexate","Placebo","methotrexate","Placebo","infliximab","aziothioprine/6MP","infliximab+aziothioprine","infliximab+aziothioprine","aziothioprine/6MP","infliximab+methotrexate","infliximab")

Then I try to run pairwise with this code:

antiplatelet=pairwise(treat=t,event=r,n,studlab=id,sm="OR")

and I get an error saying:

Error in table(as.character(studlab), as.character(treat)) : 
  all arguments must have the same length

Does anyone know why?

R netmeta • 879 views
ADD COMMENT
1
Entering edit mode

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLY
1
Entering edit mode
5.6 years ago

The error is exceptionally clear on what is wrong:

Error in table(as.character(studlab), as.character(treat)) :
all arguments must have the same length

If I check the length(id) I get 44, while length(t) is 42.

ADD COMMENT

Login before adding your answer.

Traffic: 1465 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6