datacggm {cglasso} | R Documentation |
‘datacggm
’ function is used to create a dataset from a censored Gaussian graphical model.
datacggm(X, lo, up)
X |
a (n x p)-dimensional matrix; each row is an observation from a censored Gaussian graphical model with censoring vectors |
lo |
the lower censoring vector; |
up |
the upper censoring vector; |
The function ‘datacggm
’ returns a named list with class ‘datacggm
’ containing the elements needed to fit a censored graphical lasso (cglasso) model. In output, the matrix X
is ordered according to the patter of censoring values.
There are specific method functions developed to help the user to deal with the censored values. The ‘print.datacggm
’ method function print out the left and right-censored values using the following rules: a right-censored value is labeld adding the symbol ‘+
’ at the end of the value, whereas the symbol ‘-
’ is used for the left-censored values (see examples bellow). The summary statistics about the censored values can be obtained using the method function ‘summary.datacggm
’. The original X
matrix is returned using the method function ‘as.matrix
’.
Finally, the status indicator matrix, denoted by R
, can be obtained by the function event
. The elements of this matrix specify the status of an observation as follows:
‘R[i, j] = 0
’ means that the ith observation of the jth random variable is observed;
‘R[i, j] = -1
’ means that the ith observation of the jth random variable is left-censored;
‘R[i, j] = +1
’ means that the ith observation of the jth random variable is right-censored.
‘datacggm
’ returns an object with S3 class “datacggm
”, i.e. a list containing the
following components:
X |
the (n x p)-dimensional matrix |
lo |
the lower censoring vector. |
up |
the upper censoring vector. |
R |
the augmented status indicator matrix encoding the patterns of censored values (for internal purposes only); the status indicator matrix is returned by function |
startmis |
the row of the matrix |
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro, L., Abbruzzo, A. and Vinciotti, V. (2018). l1-Penalized gaussian graphical model. Biostatistics (to appear).
event
, rdatacggm
, cglasso
and the method functions scale.datacggm
and summary.datacggm
.
set.seed(123) library("cglasso") # a dataset from a left-censored Gaussian graphical model n <- 100L p <- 5L X <- matrix(rnorm(n * p), n, p) lo <- -1 X[X <= lo] <- lo X <- datacggm(X, lo = lo) X as.matrix(X) # a dataset from a right-censored Gaussian graphical model n <- 100L p <- 5L X <- matrix(rnorm(n * p), n, p) up <- 1 X[X >= up] <- up X <- datacggm(X, up = up) X as.matrix(X) # a dataset from a censored Gaussian graphical model n <- 100L p <- 5L X <- matrix(rnorm(n * p), n, p) up <- 1 lo <- -1 X[X >= up] <- up X[X <= lo] <- lo X <- datacggm(X, lo = lo, up = up) X as.matrix(X)