event {cglasso} | R Documentation |
datacggm
’The ‘event
’ function is used to create a status indicator matrix from an object with class ‘datacggm
’. The elements of the matrix, denoted by R
, are used to specify the status of an observation:
‘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.
See examples below.
event(x)
x |
an object with class ‘ |
event
returns a (n x p)-dimensional matrix.
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro, L., Abbruzzo, A. and Vinciotti, V. (2018). l1-Penalized gaussian graphical model. Biostatistics (to appear).
datacggm
, rdatacggm
and the method function summary.datacggm
.
set.seed(123) library("cglasso") # 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) event(X) # 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) event(X) # 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) event(X)