hist.datacggm {cglasso} | R Documentation |
Histogram for a datacggm
Object
Description
Creates histograms with a normal density as background and two segments corresponding to left and/or right censored values (if any) in a conditional censored Gaussian graphical model.
Usage
## S3 method for class 'datacggm'
hist(x, breaks = "Sturges", include.lowest = TRUE, right = TRUE, nclass = NULL,
which, max.hist = 1L, save.hist = FALSE, grdev = pdf, grdev.arg,
polygon.col = adjustcolor("grey", alpha.f = 0.25), polygon.border = NA,
segments.lwd = 4L, segments.lty = 2L, segments.col = "gray40",
points.pch = c(4L, 1L), points.cex = 1.8, points.col = rep("black", 2L),
legend = TRUE, ...)
Arguments
x |
an object of class ‘ |
breaks |
one of:
See |
include.lowest |
logical; if |
right |
logical; if |
nclass |
numeric (integer). For S(-PLUS) compatibility only, |
which |
a vector of integers used to specify the response variables for which the histogram is required. |
max.hist |
the maximum number of histograms drawn in a single figure. |
save.hist |
a logical variable or a string specifying the path of the directory where plots will be saved. Letting ‘ |
grdev |
the graphics device used to save the required histograms on external files. See ‘ |
grdev.arg |
additional parameters passed to the graphics device specified by ‘ |
polygon.col |
graphical parameter; the colour for filling the area underlying the Gaussian distribution. |
polygon.border |
graphical parameter; the colour of the border of the Gaussian distribution. |
segments.lwd |
graphical parameter; the line width used in plotting the segments associated to the symbols specified by ‘ |
segments.lty |
graphical parameter; the line type used in plotting the segments associated to the symbols specified by ‘ |
segments.col |
graphical parameter; the colour used in plotting the segments associated to the symbols specified by ‘ |
points.pch |
graphical parameter; a pair of integers specifying the symbols used to plot the proportion of censored response variables (default ‘ |
points.cex |
graphical parameter; a numerical value giving the amount by which the symbols, specified by ‘ |
points.col |
graphical parameter; the colours used to plot the symbols specified by ‘ |
legend |
logical; if ‘ |
... |
additional graphical parameters passed to ‘ |
Details
For each response variable, the method function ‘hist.datacggm
’ plots a histogram using only the observed values. Densities, plotted on the y
-axis, are computed in such a way that the sum of all densities plus the proportion of censored values is equal to one.
To evaluate the distributional assumption underlying the censored Gaussian distribution, on each histogram the area underlying the Gaussian density function is also shown in the background (marginal parameters are estimated as described in ‘datacggm
’ and ‘ColMeans
’). Furthermore, on each plot, the proportions of left/right censored values are graphically compared with the corresponding Gaussian tail probabilities. If the assumption about the censoring mechanism is satisfied, then the proportion of censored values and the tail probability are approximately equals to each other.
Author(s)
Gianluca Sottile (gianluca.sottile@unipa.it)
See Also
datacggm
, rcggm
, ColMeans
, ColVars
and qqcnorm
.
Examples
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)
hist(Z, max.hist = 4L)