[R] Change Rcode for a meta-analysis(netmeta) to use a random effects model instead of a mixed effects model

Viechtbauer Wolfgang (SP) wolfgang.viechtbauer at maastrichtuniversity.nl
Thu Jun 29 19:47:21 CEST 2017

The code in your mail in a mangled mess, since you posted in HTML. Please configure your email client to send emails in plain text. 

Could you explain what exactly you mean by "Currently it is using a mixed effects model. Is it possible to change the code so a random effects model is used?"


>-----Original Message-----
>From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jay Zola
>Sent: Thursday, June 29, 2017 19:38
>To: r-help at r-project.org
>Subject: [R] Change Rcode for a meta-analysis(netmeta) to use a random
>effects model instead of a mixed effects model
>I am writing a meta-analysis on the complication and reoperation rates
>after 5 treatment modalities of a distal radius fracture. I have a code to
>compare the complication and reoperation rates. Currently it is using a
>mixed effects model. Is it possible to change the code so a random effects
>model is used?
>Thank you very much,
>R code
>library(meta) library(readxl) All <- read_excel("Basics excel file
>complication and reoperation rate.xlsx", sheet=1) names(All) <-
>c("Study_ID","Event_Type","Treatment","Events_n","N","nN") All$Treatment
><- factor(All$Treatment, levels=c("PC","EF","IMN","KW","VPO")) # Outcomes
>Complications <- subset(All, Event_Type=="Complications") Reoperations <-
>subset(All, Event_Type=="Reoperations") # Comparison of treatment effects
>to gold standard in the Complications subset mtpr1 <- metaprop(Events_n,
>N, Study_ID, data = Complications) meta::metareg(mtpr1, ~Treatment) #
>Comparison of treatment effects to gold standard in the Reoperations
>subset mtpr2 <- metaprop(Events_n, N, Study_ID, data = Reoperations)
>meta::metareg(mtpr2, ~Treatment) # Comparison of treatment effects to gold
>standard in the All dataset # Interaction effects have been considered
>mtpr <- metaprop(Events_n, N, Study_ID, data = All) meta::metareg(mtpr,
>A part of the dataset:
>Study| Event Type| Treatment| Number of Events (n)| N| n/N|
>Kumaravel| Complications| EF| 3| 23| 0,1304348|
>Franck| Complications| EF| 2| 20| 0,1|
>Schonnemann| Complications| EF| 8| 30| 0,2666667|
>Aita| Complications| EF| 1| 16| 0,0625|
>Hove| Complications| EF| 31| 39| 0,7948718|
>Andersen| Complications| EF| 26| 75| 0,3466667|
>Krughaug| Complications| EF| 22| 75| 0,2933333|
>Moroni| Complications| EF| 0| 20| 0|
>Plate| Complications| IMN| 3| 30| 0,1|
>Chappuis| Complications| IMN| 4| 16| 0,25|
>Gradl| Complications| IMN| 12| 66| 0,1818182|
>Schonnemann| Complications| IMN| 6| 31| 0,1935484|
>Aita| Complications| IMN| 1| 16| 0,0625|
>Dremstrop| Complications| IMN| 17| 44| 0,3863636|
>Wong| Complications| PC| 1| 30| 0,0333333|
>Kumaravel| Complications| PC| 4| 25| 0,16|
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide http://www.R-project.org/posting-
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list