| getMatrix | R Documentation |
Y’ and ‘X’ from a ‘datacggm’ Object‘getMatrix’ retrieves matrices ‘Y’ and/or ‘X’ from an object of class ‘datacggm’.
getMatrix(x, name = c("Y", "X", "both"), ordered = FALSE)
x |
an object of class ‘ |
name |
the name of the required matrix. |
ordered |
logical value used to specify if the required matrix should be retrieved with rows ordered according to the patterns of censored values. See below for some example. |
getMatrix retrieves the matrix specified by ‘name’ and with row ordering specified by ‘ordered’. A named list returned if name is "both".
Luigi Augugliaro (luigi.augugliaro@unipa.it)
Augugliaro L., Sottile G., Wit E.C., and Vinciotti V. (2023) <\Sexpr[results=rd,stage=build]{tools:::Rd_expr_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) <\Sexpr[results=rd,stage=build]{tools:::Rd_expr_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) <\Sexpr[results=rd,stage=build]{tools:::Rd_expr_doi("10.1093/biostatistics/kxy043")}>. l1-Penalized censored Gaussian graphical model. Biostatistics 21, e1–e16.
datacggm, rcggm.
set.seed(123) # a dataset from a conditional censored Gaussian graphical model 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) Z <- rcggm(n = n, b0 = b0, X = X, B = B, probl = 0.05, probr = 0.05) getMatrix(Z, name = "Y") # in the following examples 'Y' and 'X' is returned with rows ordered # according to the patterns of censored data getMatrix(Z, name = "Y", ordered = TRUE) getMatrix(Z, name = "X") getMatrix(Z, name = "X", ordered = TRUE) getMatrix(Z, name = "both") getMatrix(Z, name = "both", ordered = TRUE)