Learn R Programming

MVR (version 1.20.0)

stabilization.diagnostic: Function for Plotting Summary Variance Stabilization Diagnostic Plots

Description

Plot comparative variance-mean plots to check the variance stabilization across variables before and after Mean-Variance Regularization.

Usage

stabilization.diagnostic(obj, 
                             title = "", 
                             span = 0.5, 
                             degree = 2, 
                             family = "gaussian", 
                             device = NULL, 
                             file = "Stabilization Diagnostic Plots")

Arguments

obj
Object of class "mvr" returned by mvr.
title
Title of the plot. Defaults to the empty string.
span
Span parameter of the loess() function (R package stats), which controls the degree of smoothing. Defaults to 0.75.
degree
Degree parameter of the loess() function (R package stats), which controls the degree of the polynomials to be used. Defaults to 2. (Normally 1 or 2. Degree 0 is also allowed, but see the "Note" in loess {stats} pa
family
Family distribution in {"gaussian", "symmetric"} of the loess() function (R package stats), used for local fitting . If "gaussian" fitting is by least-squares, and if "symmetric" a re-descending M estimator is used
device
Graphic display device in {NULL, "PS", "PDF"}. Defaults to NULL (screen). Currently implemented graphic display devices are "PS" (Postscript) or "PDF" (Portable Document Format).
file
File name for output graphic. Defaults to "Stabilization Diagnostic Plots".

Value

  • None. Displays the plots on the chosen device.

Details

In the plots of standard deviations vs. means, standard deviations and means are calculated in a feature-wise manner from the expression matrix. The scatterplot allows to visually verify whether there is a dependence of the standard deviation (or variance) on the mean. The black dotted line depicts the LOESS scatterplot smoother estimator. If there is no variance-mean dependence, then this line should be approximately horizontal. Option file is used only if device is specified (i.e. non NULL).

References

  • Dazard J-E., Hua Xu and J. S. Rao (2011). "R package MVR for Joint Adaptive Mean-Variance Regularization and Variance Stabilization." In JSM Proceedings, Section for Statistical Programmers and Analysts. Miami Beach, FL, USA: American Statistical Association IMS - JSM, 3849-3863.
  • Dazard J-E. and J. S. Rao (2012). "Joint Adaptive Mean-Variance Regularization and Variance Stabilization of High Dimensional Data." Comput. Statist. Data Anal. 56(7):2317-2333.

See Also

justvsn (R package vsn) Variance stabilization and calibration for microarray data. loess (R package stats) Fit a polynomial surface determined by one or more numerical predictors, using local fitting.

Examples

Run this code
#===================================================
# Loading the library and its dependencies
#===================================================
library("MVR")

#===================================================
# Loading of the Synthetic and Real datasets 
# (see description of datasets)
#===================================================
data("Synthetic", "Real", package="MVR")

#===================================================
# Mean-Variance Regularization (Real dataset)
# Multi-Group Assumption
# Assuming unequal variance between groups
# Without cluster usage
#===================================================
nc.min <- 1
nc.max <- 30
probs <- seq(0, 1, 0.01)
n <- 6
GF <- factor(gl(n = 2, k = n/2, len = n), 
             ordered = FALSE, 
             labels = c("M", "S"))
mvr.obj <- mvr(data = Real, 
               block = GF, 
               log = FALSE, 
               nc.min = nc.min, 
               nc.max = nc.max, 
               probs = probs,
               B = 100, 
               parallel = FALSE, 
               conf = NULL,
               verbose = TRUE)

#===================================================
# Summary Stabilization Diagnostic Plots (Real dataset)
# Multi-Group Assumption
# Assuming unequal variance between groups
#===================================================
stabilization.diagnostic(obj = mvr.obj, 
                         title = "Stabilization Diagnostic Plots 
                         (Real - Multi-Group Assumption)",
                         span = 0.75, 
                         degree = 2, 
                         family = "gaussian",
                         device = "PS")

#===================================================
# Mean-Variance Regularization (Real dataset)
# Single-Group Assumption
# Assuming equal variance between groups
# Without cluster usage
#===================================================
nc.min <- 1
nc.max <- 30
probs <- seq(0, 1, 0.01)
n <- 6
mvr.obj <- mvr(data = Real, 
               block = rep(1,n), 
               log = FALSE, 
               nc.min = nc.min, 
               nc.max = nc.max, 
               probs = probs, 
               B = 100, 
               parallel = FALSE, 
               conf = NULL, 
               verbose = TRUE)

#===================================================
# Summary Stabilization Diagnostic Plots (Real dataset)
# Single-Group Assumption
# Assuming equal variance between groups
#===================================================
stabilization.diagnostic(obj = mvr.obj, 
                         title = "Stabilization Diagnostic Plots 
                         (Real - Single-Group Assumption)", 
                         span = 0.75, 
                         degree = 2, 
                         family = "gaussian",
                         device = NULL)

Run the code above in your browser using DataLab