Learn R Programming

metafor (version 1.9-4)

qqnorm.rma.uni: Normal QQ Plots for 'rma' Objects

Description

Function to create normal QQ plots for objects of class "rma.uni", "rma.mh", and "rma.peto".

Usage

## S3 method for class 'rma.uni':
qqnorm(y, type="rstandard", pch=19, envelope=TRUE, level=y$level,
       bonferroni=FALSE, reps=1000, smooth=TRUE, bass=0, label=FALSE, offset=0.3, \dots)
## S3 method for class 'rma.mh':
qqnorm(y, type="rstandard", pch=19, label=FALSE, offset=0.3, \dots)
## S3 method for class 'rma.peto':
qqnorm(y, type="rstandard", pch=19, label=FALSE, offset=0.3, \dots)
## S3 method for class 'rma.glmm':
qqnorm(y, \dots)
## S3 method for class 'rma.mv':
qqnorm(y, \dots)

Arguments

y
an object of class "rma.uni", "rma.mh", or "rma.peto". The method is not yet implemented for objects of class "rma.glmm" or "rma.mv".
type
either "rstandard" (default) or "rstudent" indicating whether standardized residuals or studentized deleted residuals should be used in creating the plot. See Details.
pch
plotting symbol to use for the observed effect sizes or outcomes. By default, a solid circle is used. See points for other options.
envelope
logical indicating whether a pseudo confidence envelope should be simulated and added to the plot (default is TRUE)). Only for objects of class "rma.uni". See Details.
level
numerical value between 0 and 100 specifying the level of the pseudo confidence envelope (the default is to take the value from the object).
bonferroni
logical indicating whether the bounds of the envelope should be Bonferroni corrected.
reps
numerical value indicating the number of iterations to use for simulating the pseudo confidence envelope (default is 1000).
smooth
logical indicating whether the results from the simulation should be smoothed (default is TRUE).
bass
numerical value that controls the degree of smoothing (default is 0).
label
argument to control the labeling of the points (default is FALSE). See Details.
offset
argument to control the distance between the points and the corresponding labels (default is 0.3).
...
other arguments.

Value

  • A list with components:
  • xthe x coordinates of the points that were plotted.
  • ythe y coordinates of the points that were plotted.
  • Note that the list is returned invisibly.

Details

The plot shows the theoretical quantiles of a normal distribution on the horizontal axis against the observed quantiles for either the standardized residuals (type="rstandard", the default) or the externally standardized residuals (type="rstudent") on the vertical axis (see residuals.rma for details on the definition of these residual types). For reference, a line is added to the plot with slope of 1, going through the (0,0) point. For objects of class "rma.uni", it is also possible to add a pseudo confidence envelope to the plot. The envelope is created based on the quantiles of sets of pseudo residuals simulated from the given model (for details, see Cook & Weisberg, 1982). The number of sets simulated can be controlled with the reps argument. When smooth=TRUE, the simulated bounds are smoothed with Friedman's SuperSmoother (see supsmu). The bass argument can be set to a number between 0 and 10, with higher numbers indicating increasing smoothness. If bonferroni=TRUE, the envelope bounds are Bonferroni corrected, so that the envelope can be regarded as a confidence region for all $k$ residuals simultaneously. The default however is bonferroni=FALSE, which makes the plot more sensitive to deviations from normality. With the label argument, one can control whether points in the plot will be labeled (e.g., to identify outliers). If label="all", all points in the plot will be labeled. If label="out", points falling outside of the confidence envelope will be labeled (only available for objects of class "rma.uni"). Finally, one can also set this argument to a numeric value (between 1 and $k$), indicating how many of the most extreme points should be labeled (for example, with label=1 only the most extreme point would be labeled, while with label=3, the most extreme, and the second and third most extreme points would be labeled). With the offset argument, the distance between the labels and the corresponding points can be controlled.

References

Cook, R. D., & Weisberg, S. (1982). Residuals and influence in regression. London: Chapman and Hall. Viechtbauer, W. (2010). Conducting meta-analyses in R with the metafor package. Journal of Statistical Software, 36(3), 1--48. http://www.jstatsoft.org/v36/i03/. Wang, M. C., & Bushman, B. J. (1998). Using the normal quantile plot to explore meta-analytic data sets. Psychological Methods, 3, 46--54.

See Also

rma.uni, rma.mh, rma.peto, rma.glmm, rma.mv

Examples

Run this code
### load BCG vaccine data
data(dat.bcg)

### meta-analysis of the log relative risks using a random-effects model
res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
qqnorm(res)

### mixed-effects model with absolute latitude as a moderator
res <- rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, mods = ~ ablat,
           data=dat.bcg)
qqnorm(res)

Run the code above in your browser using DataLab