View source: R/datacggm_tools.R
event | R Documentation |
datacggm
’ ObjectThe ‘event
’ function retrieves the status indicator matrix from an object of class ‘datacggm
’.
event(x, ordered = FALSE)
x |
an object of class ‘ |
ordered |
logical value used to specify if the rows of the status indicator matrix should be ordered according to the patterns of censored/missing values. Default |
The ‘event
’ function is used to retrieve the status indicator matrix, denoted by R
, from an object of class ‘datacggm
’. The entries of the matrix are used to specify the status of the response variable:
‘R[i, j] = 0
’ means that y_{ij} is inside the open interval (lo[j], up[j])
;
‘R[i, j] = -1
’ means that y_{ij} is a left-censored value;
‘R[i, j] = +1
’ means that y_{ij} is a right-censored value;
‘R[i, j] = +9
’ means that y_{ij} is a missing value.
event
returns a (n x p)-dimensional matrix.
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro L., Sottile G., Wit E.C., and Vinciotti V. (2023) <doi: 10.18637/jss.v105.i01>. cglasso: An R Package for Conditional Graphical Lasso Inference with Censored and Missing Values. Journal of Statistical Software 105(1), 1–58.
Augugliaro, L., Sottile, G., and Vinciotti, V. (2020) <doi: 10.1007/s11222-020-09945-7>. The conditional censored graphical lasso estimator. Statistics and Computing 30, 1273–1289.
Augugliaro, L., Abbruzzo, A., and Vinciotti, V. (2020) <doi: 10.1093/biostatistics/kxy043>. l1-Penalized censored Gaussian graphical model. Biostatistics 21, e1–e16.
datacggm
and rcggm
.
set.seed(123) # Y ~ N(b0 + XB, Sigma) and # 1. probability of left/right censored values equal to 0.05 # 2. probability of missing-at-random euqals to 0.05 n <- 100L p <- 3L q <- 2 b0 <- runif(p) B <- matrix(runif(q * p), nrow = q, ncol = p) X <- matrix(rnorm(n * q), nrow = n, ncol = q) rho <- 0.3 Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j)) Z <- rcggm(n = n, b0 = b0, X = X, B = B, Sigma = Sigma, probl = 0.05, probr = 0.05, probna = 0.05) # status indicator matrix event(Z) # in this case the status indicator matrix is returned with # rows ordered according to the patterns of missing data event(Z, ordered = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.