Learn R Programming

cglasso (version 2.0.2)

qqcnorm: Quantile-Quantile Plots for a datacggm Object

Description

Creates a quantile-quantile plot for a censored Gaussian distribution.

Usage

qqcnorm(x, which, max.plot = 1L, save.plot = FALSE, grdev = pdf, grdev.arg,
        main = "Censored Normal Q-Q Plot", xlab = "Theoretical Quantiles",
        ylab = "Sample Quantiles", plot.it = TRUE, plot.pch = c(2L, 20L),
        plot.col = c(2L, 1L), plot.cex = c(2L, 1L), abline = FALSE,
        line.col = "gray50", line.lwd = 1L, line.lty = 2L, …)

Arguments

x

an object of class ‘datacggm’.

which

a vector of integers used to specify the response variables for which the histogram is required.

max.plot

the maximum number of plots drawn in a single figure.

save.plot

logical; if ‘TRUE’ the required plots are saved on external files.

grdev

the graphics device used to save the required histograms on external files. See ‘device’ for more details.

grdev.arg

additional parameters passed to the graphics device specified by ‘grdev’.

main, xlab, ylab

plot labels.

plot.it

logical. Should the result be plotted?

plot.pch

a pair of graphical parameters. The first entry specifies the symbol used for plotting the points associated to the censoring values \(lo\) and \(up\) (by default a triangle), whereas the second entry specifies the symbol used for the remaining points (by default a black point).

plot.col

a pair of graphical parameters. The first entry specifies the colour used for plotting the points associated to the censoring values \(lo\) and \(up\) (by default a red triangle), whereas the second entry specifies the colour used for the remaining points (by default a black point).

plot.cex

a pair of graphical parameters. The first entry specifies the size of the symbol used for plotting the points associated to the censoring values \(lo\) and \(up\), whereas the second entry specifies the size of the symbol used for the remaining points.

abline

logical. Should the line \(y = x\) be plotted?

line.col

graphical parameter. If ‘abline = TRUE’, then this argument specifies the colour of the line \(y = x\).

line.lwd

graphical parameter. If ‘abline = TRUE’, then this argument specifies the line width of the line \(y = x\).

line.lty

graphical parameter. If ‘abline = TRUE’, then this argument specifies the line type of the line \(y = x\).

additional graphical parameter passed to ‘plot’.

Value

A named list is silently returned. Each element of the list contains a two-columns matrix; first columns (named ‘x’) contains the theoretical quantiles whereas second columns (named ‘y’) contains the empirical quantiles.

Details

qqcnorm’ produces a censored normal QQ plot, that is, a graphical method for comparing the empirical distribution of a given response variable (specified by the argument which) to the censored Gaussian distribution, which is defined as:

\(\Phi((lo - \mu)/\sigma)\) if \(y\le lo\)
\(\phi((y - \mu)/\sigma) / \sigma\) if \(lo < y < up\)

where \(\phi\) and \(\Phi\) are the probability density function and the cumulative ditribution of the standard normal distribution, respectively, whereas \(lo\) and \(up\) are the lower and upper censoring values, respectively.

The comparison is done by plotting the empirical quantiles (\(y\)-coordinate) against the theoretical quantiles (\(x\)-coordinate) of the censored Gaussian distribution, which are defined as follows:

\(lo\) if \(p \le \Phi((lo - \mu)/\sigma)\)
\(\mu + \sigma \Phi^{-1}(p)\) if \(\Phi((lo - \mu)/\sigma) < p < 1 - \Phi((up - \mu)/\sigma)\)

where \(p\in(0, 1)\). If the two distributions are similar, the points will approximately lie on the line \(y = x\). If the distributions are linearly related, the points will approximately lie on a line, but not necessarily on the line \(y = x\). In order to evaluate if the proportions of left/right-censored values are similar to the Gaussian tail probabilities, points corresponding to the censored values are plotted using a specific symbol (see argument ‘plot.pch’), colour (see argument ‘plot.col’) and size (see argument ‘plot.cex’).

Finally, maximum likelihood estimates of the marginal parameters \(\mu\) and \(\sigma\) are computed as described in ‘datacggm’ and can be extracted from an R of class ‘datacggm’ by using the functions ‘ColMeans’ and ‘ColVars’, respectively.

References

Augugliaro, L., Sottile, G., and Vinciotti, V. (2020) <10.1007/s11222-020-09945-7>. The conditional censored graphical lasso estimator. Statistics and Computing 30, 1273--1289.

Augugliaro, L., Abbruzzo, A., and Vinciotti, V. (2020) <10.1093/biostatistics/kxy043>. \(\ell_1\)-Penalized censored Gaussian graphical model. Biostatistics 21, e1--e16.

See Also

datacggm, rcggm, ColMeans, ColVars and hist.datacggm.

Examples

Run this code
# NOT RUN {
set.seed(123)

# a dataset from a right-censored Gaussian graphical model
n <- 1000L
p <- 10L
Y <- matrix(rnorm(n * p), n, p)
up <- 1
Y[Y >= up] <- up
Z <- datacggm(Y = Y, up = up)
qqcnorm(Z, max.plot = 4L)

# a dataset from a  conditional censored Gaussian graphical model
n <- 1000L
p <- 10L
q <- 2
Y <- matrix(rnorm(n * p), n, p)
up <- 1
lo <- -1
Y[Y >= up] <- up
Y[Y <= lo] <- lo
X <- matrix(rnorm(n * q), n, q)
Z <- datacggm(Y = Y, lo = lo, up = up, X = X)
qqcnorm(Z, max.plot = 4L)
# }

Run the code above in your browser using DataLab