Skip to content

Instantly share code, notes, and snippets.

@joaovissoci
Created August 4, 2014 13:16
Show Gist options
  • Save joaovissoci/57c047beb25d41bb445d to your computer and use it in GitHub Desktop.
Save joaovissoci/57c047beb25d41bb445d to your computer and use it in GitHub Desktop.
Error_with_netmet
###########################################################################################
#Generating data
###########################################################################################
vo2<-structure(list(studlab = structure(c(8L, 4L, 10L, 9L, 11L, 13L,
6L, 6L, 14L, 12L, 2L, 7L, 3L, 5L), .Label = c("", "Akiba et al., 1995",
"Carney et al., 1987", "Deligiannis; Kouidi, Tourkantonis, 1999 a",
"Goldberg et al., 1983", "Konstantinidou et al., 2002", "Kouidi et al., 1997",
"Kouidi et al., 2010", "Kouidi; Grekas; Deligiannis, 2009", "Molsted et al., 2004",
"Ouzoni et al., 2009", "Painter et al., 2002", "Petraki et al., 2008",
"Reboredo et al., 2011", "Tsuyuki et al., 2003"), class = "factor"),
treat1 = structure(c(3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 2L,
2L, 2L, 2L, 2L, 2L), .Label = c("", "EA", "TC"), class = "factor"),
Ntreatment = c(24L, 30L, 11L, 30L, 19L, 22L, 16L, 10L, 12L,
13L, 9L, 20L, 10L, 14L), Ngroupc = c(20L, 30L, 9L, 29L, 14L,
21L, 12L, 12L, 12L, 12L, 6L, 11L, 7L, 11L), meantreatment = c(22.33,
24, 23.6, 21.4, 25.3, 25.1, 23.7, 19, 29, 22.12, 20, 23.2,
22.7, 25), sdtreatment = c(4.9, 7, 7.4, 6.8, 5.3, 6.1, 7.7,
5.3, 7, 10.78, 2.3, 7.6, 2.1, 9), meancontrole = c(15.33,
16, 22.9, 16.5, 20.1, 20.8, 15.8, 15.8, 28.6, 20.16, 17.6,
15.9, 18.6, 20), sdcontrole = c(3.79, 6, 4.4, 4.5, 3.4, 4.6,
4.8, 4.8, 7, 7.23, 2.6, 4.3, 3.9, 8), treat2 = c("control",
"control", "control", "control", "control", "control", "control",
"control", "control", "control", "control", "control", "control",
"control"), TE = c(7, 8, 0.700000000000003, 4.9, 5.2, 4.3,
7.9, 3.2, 0.399999999999999, 1.96, 2.4, 7.3, 4.1, 5), seTE = c(6.19468320416791,
9.21954445729289, 8.60929730001235, 8.15414005275847, 6.29682459657247,
7.64002617796562, 9.07358804442873, 7.1505244562899, 9.89949493661167,
12.9800346686748, 3.47131099154196, 8.73212459828649, 4.42944691807002,
12.0415945787923)), .Names = c("studlab", "treat1", "Ntreatment",
"Ngroupc", "meantreatment", "sdtreatment", "meancontrole", "sdcontrole",
"treat2", "TE", "seTE"), row.names = c(1L, 2L, 3L, 4L, 5L, 6L,
7L, 8L, 9L, 10L, 14L, 15L, 16L, 17L), na.action = structure(11:13, .Names = c("11",
"12", "13"), class = "omit"), class = "data.frame")
#####################################################################################
#SETTING ENVIRONMENT
#####################################################################################
library(metafor)
library(meta)
library(netmeta)
#####################################################################################
#SETTING ENVIRONMENT
#####################################################################################
##
net1 <- netmeta(TE, seTE, treat1, treat2,
studlab,
data=vo2, sm="MD", reference="control")
### ERROR
#Error in netmeta(TE, seTE, treat1, treat2, studlab, data = vo2, sm = "MD", :
# Study 'Konstantinidou et al., 2002' has a wrong number of comparisons.
# Please provide data for all treatment comparisons (two-arm: 1; three-arm: 3; four-arm: 6, ...).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment