datacggm
ObjectCreates 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.
# S3 method for 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, …)
an object of class ‘datacggm
’.
one of:
a vector giving the breakpoints between histogram cells,
a function to compute the vector of breakpoints,
a single number giving the number of cells for the histogram,
a character string naming an algorithm to compute the number of cells,
a function to compute the number of cells.
See hist
for more details.
logical; if TRUE
, an x[i]
equal to the breaks value will be included in the first (or last, for right = FALSE
) bar. This will be ignored (with a warning) unless breaks
is a vector.
logical; if TRUE
, the histogram cells are right-closed (left open) intervals.
numeric (integer). For S(-PLUS) compatibility only, nclass
is equivalent to breaks
for a scalar or character argument.
a vector of integers used to specify the response variables for which the histogram is required.
the maximum number of histograms drawn in a single figure.
logical; if ‘TRUE
’ required histograms are saved on external files.
the graphics device used to save the required histograms on external files. See ‘device
’ for more details.
additional parameters passed to the graphics device specified by ‘grdev
’.
graphical parameter; the colour for filling the area underlying the Gaussian distribution.
graphical parameter; the colour of the border of the Gaussian distribution.
graphical parameter; the line width used in plotting the segments associated to the symbols specified by ‘points.pch
’.
graphical parameter; the line type used in plotting the segments associated to the symbols specified by ‘points.pch
’.
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.pch = 4L
’) and the probability to observe a censored value (default ‘points.pch = 1L
’), respectively.
graphical parameter; a numerical value giving the amount by which the symbols, specified by ‘points.pch
’, are magnified relative to the default.
graphical parameter; the colours used to plot the symbols specified by ‘points.pch
’.
logical; if ‘TRUE
’ legend is added to the plot.
additional graphical parameters passed to ‘plot.histogram
’.
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.
# 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)
hist(Z, max.hist = 4L)
# }
Run the code above in your browser using DataLab