Learn R Programming

cglasso (version 1.1.2)

datacggm: Create a Dataset from a Censored Gaussian Graphical Model

Description

datacggm’ function is used to create a dataset from a censored Gaussian graphical model.

Usage

datacggm(X, lo, up)

Arguments

X

a \((n\times p)\)-dimensional matrix; each row is an observation from a censored Gaussian graphical model with censoring vectors lo and up.

lo

the lower censoring vector; lo[j] is used to specify the lower censoring value for the random variable \(X_j\).

up

the upper censoring vector; up[j] is used to specify the upper censoring value for the random variable \(X_j\).

Value

datacggm’ returns an object with S3 class “datacggm”, i.e. a list containing the following components:

X

the \((n\times p)\)-dimensional matrix X ordered according to the patterns of censored values.

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 event.

startmis

the row of the matrix X where are starting the patterns of censored values (for internal purposes only).

Details

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 \(i\)th observation of the \(j\)th random variable is observed;

  • R[i, j] = -1’ means that the \(i\)th observation of the \(j\)th random variable is left-censored;

  • R[i, j] = +1’ means that the \(i\)th observation of the \(j\)th random variable is right-censored.

References

Augugliaro, L., Abbruzzo, A. and Vinciotti, V. (2018). \(\ell_1\)-Penalized gaussian graphical model. Biostatistics (to appear).

See Also

event, rdatacggm, cglasso and the method functions scale.datacggm and summary.datacggm.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab