Learn R Programming

MAMA (version 1.0.2)

plotQvsChi: Function to plot quantiles of Cochran's Q statistic and Chi-square quantiles.

Description

Function plots quantiles of Cochran's Q statistic and Chi-square quantiles as a scatter plot with diagonal line. Plot can help to decide between random-effect and fixed-effect model. It is a wrapper function to provide a complete plot.

Usage

plotQvsChi(Q, num.studies)

Arguments

Q
A vector of Cochran's Q statistic used to test between-study variability.
num.studies
Number of studies involved in meta-analysis.

Examples

Run this code
## The function is currently defined as
function(Q,num.studies)
{
 chisqq <- qchisq(seq(0, 0.9999, 0.001), df = num.studies-1)
 tmp <- quantile(my.Q, seq(0, 0.9999, 0.001))
 qqplot(chisqq, tmp, ylab = "Quantiles of Sample", pch = "*", 
 xlab = "Quantiles of Chi > square", main = "QQ Plot")
 lines(chisqq, chisqq, lty = "dotted", col = "red")
  }

Run the code above in your browser using DataLab