Learn R Programming

MAc (version 1.1.1)

plotcon: Meta Regression Scatterplot

Description

Outputs a scatterplot from a fixed or random effects meta regression (continuous and/or categorical).

Usage

plotcon(es, var, mod, data, method= "random", modname=NULL, 
  title=NULL, ylim=c(0, 1), ...)

Arguments

es

r or z' effect size.

var

Vaiance of g.

mod

Categorical moderator variable used for moderator analysis.

method

Default is random. For fixed effects, use fixed.

data

data.frame with values above.

modname

Name of moderator to appear on x axis of plot. Default is NULL.

title

Plot title. Default is NULL.

ylim

Limits of y-axis with the first argument for the minimum y-value and the second for the maximum y value. Default is c(0, 1).

...

Additional arguments to be passed to ggplot.

Value

Scatterplot with fixed or random effects regression line with size of visual points based on study weights, where the more precise studies have larger points. The ggplot2 package outputs the rich graphics.

References

Cooper, H., Hedges, L.V., & Valentine, J.C. (2009). The handbook of research synthesis and meta analysis (2nd edition). New York: Russell Sage Foundation.

See Also

mareg, plotcat

Examples

Run this code
# NOT RUN {
id<-c(1:20)
n<-c(10,20,13,22,28,12,12,36,19,12,36,75,33,121,37,14,40,16,14,20)
r<-c(.68,.56,.23,.64,.49,-.04,.49,.33,.58,.18,-.11,.27,.26,.40,.49,
.51,.40,.34,.42,.16)
mod1<-c(1,2,3,4,1,2,8,7,5,3,9,7,5,4,3,2,3,5,7,1)
dat<-data.frame(id,n,r,mod1)
dat$var.r <- var_r(dat$r, dat$n) # MAc function to derive variance
dat$z <- r_to_z(dat$r)  # MAc function to convert to Fisher's z (z')
dat$var.z <- var_z(dat$n)  # MAc function for variance of z'
dat$mods2 <- factor(rep(1:2, 10))

# Example

# }
# NOT RUN {
plotcon(es = r, var = var.r, mod = mod1, data = dat, method= "random", 
modname= "Moderator") 
# }

Run the code above in your browser using DataLab