The metafor Package

A Meta-Analysis Package for R

User Tools

Site Tools


plots:labbe_plot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plots:labbe_plot [2024/04/18 13:56] Wolfgang Viechtbauerplots:labbe_plot [2024/04/18 14:17] (current) Wolfgang Viechtbauer
Line 18: Line 18:
 res <- rma(measure="OR", ai=xt, n1i=nt, ci=xc, n2i=nc, data=dat) res <- rma(measure="OR", ai=xt, n1i=nt, ci=xc, n2i=nc, data=dat)
  
-### set up plotting device with a 2x2 layout+### set up 2x2 array for plotting
 par(mfrow=c(2,2)) par(mfrow=c(2,2))
 +
 +### decrease the overall point sizes a bit
 +par(cex=0.7)
  
 ### default plot with log odds on the x- and y-axis ### default plot with log odds on the x- and y-axis
Line 26: Line 29:
 ### plot with some customization ### plot with some customization
 labbe(res, ci=TRUE, pi=TRUE, grid=TRUE, legend=TRUE, bty="l", labbe(res, ci=TRUE, pi=TRUE, grid=TRUE, legend=TRUE, bty="l",
-      xlab="Log Odds (Treatment Group)", ylab="Log Odds (Control Group)")+      xlab="Log Odds (Control Group)", ylab="Log Odds (Treatment Group)")
  
 ### plot with odds values on the x- and y-axis and some customization ### plot with odds values on the x- and y-axis and some customization
 labbe(res, ci=TRUE, pi=TRUE, grid=TRUE, legend=TRUE, bty="l", labbe(res, ci=TRUE, pi=TRUE, grid=TRUE, legend=TRUE, bty="l",
-      transf=exp, xlab="Odds (Treatment Group)", ylab="Odds (Control Group)")+      transf=exp, xlab="Odds (Control Group)", ylab="Odds (Treatment Group)")
  
 ### plot with risk values on the x- and y-axis and some customization ### plot with risk values on the x- and y-axis and some customization
 labbe(res, ci=TRUE, pi=TRUE, grid=TRUE, legend=TRUE, bty="l", labbe(res, ci=TRUE, pi=TRUE, grid=TRUE, legend=TRUE, bty="l",
-      transf=plogis, lim=c(0,1), xlab="Risk (Treatment Group)", +      transf=plogis, lim=c(0,1), xlab="Risk (Control Group)", 
-      ylab="Risk (Control Group)")+      ylab="Risk (Treatment Group)")
 </code> </code>
  
plots/labbe_plot.txt · Last modified: 2024/04/18 14:17 by Wolfgang Viechtbauer