Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

title, complab, outclab, byseparator don't work in metaprop #2

Closed
mankowitz opened this issue Sep 12, 2017 · 2 comments
Closed

title, complab, outclab, byseparator don't work in metaprop #2

mankowitz opened this issue Sep 12, 2017 · 2 comments

Comments

@mankowitz
Copy link

In the following code,

library(meta)
studies <- c("Cong 2015","Parsch 2017","Gangathimmaiah 2017","Isbister 2016","Kowalski 2015","Riddell 2017","Scaggs 2016","Schepke 2015","Olives 2016","Cole 2016","Burnett 2015","Keseg 2014","Hollis 2017","Burnett 2012")		
obs <- c(0,0,3,0,0,2,0,2,85,25,14,8,10,2)
denom <- c(18,22,21,49,5,23,7,52,135,64,49,35,38,12)
grouping <- c("AMT","AMT","AMT","ED","ED","ED","EMS","EMS","EMS","EMS","EMS","EMS","EMS","EMS")
m1 <- metaprop(obs, denom, studies, comb.random=FALSE,
complab="N", outclab="intubated", title="Intubation rates",
byvar=grouping, bylab="Setting", byseparator=":")                                    
forest(m1)

The complab, coutclab, byseparator and title do not appear.

@guido-s
Copy link
Owner

guido-s commented Sep 19, 2017

Thank you for the hint.

I changed the default for argument 'byseparator' in forest.meta() in the GitHub version of R package meta. Now, the value for this argument defined in meta-analysis functions - like metaprop() - is recognized by forest.meta().

The other arguments are only used at the moment in the printing of meta-analysis objects. See, e.g., output of R command summary(m1) .

You can use grid.text to add a title to a forest plot. E.g.,

pdf("forest-with-title.pdf", width = 9.5, height = 8)
##
forest(m1, calcwidth.hetstat = TRUE)
grid::grid.text("Intubation rates", 0.5, 0.96, gp = grid::gpar(cex = 2))
grid::grid.text("intubated", 0.5, 0.92, gp = grid::gpar(cex = 1.5))
##
dev.off()

@guido-s guido-s closed this as completed Sep 19, 2017
@mankowitz
Copy link
Author

mankowitz commented Jan 21, 2018

thanks! The code snippet works well for the title, which is superimposed on top of the plot.

To change the column headings in the forest plot, I had to add leftlabs=c("Study","Intubated","Total")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants