| boot_lucid | R Documentation |
Generate R bootstrap replicates of LUCID parameters and
derive confidence interval (CI) based on bootstrap. Bootstrap replicates are
generated by nonparametric resampling, implemented with the ordinary
method of boot::boot. Supports lucid_model = "early",
lucid_model = "parallel", and lucid_model = "serial".
boot_lucid(
G,
Z,
Y,
lucid_model = c("early", "parallel", "serial"),
CoG = NULL,
CoY = NULL,
model,
conf = 0.95,
R = 100,
verbose = FALSE
)
G |
Exposures, a numeric vector, matrix, or data frame. Categorical variable should be transformed into dummy variables. If a matrix or data frame, rows represent observations and columns correspond to variables. |
Z |
Omics data: for LUCID early integration, a numeric matrix/data frame; for LUCID in parallel, a list of numeric matrices/data frames. Rows correspond to observations and columns correspond to variables. |
Y |
Outcome, a numeric vector. Categorical variable is not allowed. Binary outcome should be coded as 0 and 1. |
lucid_model |
Specifying LUCID model, "early" for early integration, "parallel" for LUCID in parallel, "serial" for LUCID in serial. Bootstrap inference is implemented for all three model types. |
CoG |
Optional, covariates to be adjusted for estimating the latent cluster. A numeric vector, matrix or data frame. Categorical variable should be transformed into dummy variables. |
CoY |
Optional, covariates to be adjusted for estimating the association between latent cluster and the outcome. A numeric vector, matrix or data frame. Categorical variable should be transformed into dummy variables. |
model |
A LUCID model fitted by |
conf |
A numeric scalar between 0 and 1 to specify confidence level(s) of the required interval(s). |
R |
An integer to specify number of bootstrap replicates for LUCID model. If feasible, it is recommended to set R >= 1000. |
verbose |
A flag indicates whether detailed information is printed in console. Default is FALSE. |
A list containing:
beta |
Bootstrap CI table(s) for G-to-X effects. For
|
mu |
Bootstrap CI table(s) for cluster-specific means of omics features.
For |
gamma |
Bootstrap CI table for X-to-Y parameters. |
stage |
For |
bootstrap |
The |
# use simulated data
G <- sim_data$G[1:300, , drop = FALSE]
Z <- sim_data$Z[1:300, , drop = FALSE]
Y_normal <- sim_data$Y_normal[1:300]
# fit lucid model
fit1 <- estimate_lucid(G = G, Z = Z, Y = Y_normal, lucid_model = "early",
family = "normal", K = 2,
seed = 1008)
# conduct bootstrap resampling
boot1 <- suppressWarnings(
boot_lucid(G = G, Z = Z, Y = Y_normal,
lucid_model = "early", model = fit1, R = 5)
)
# Use 90% CI
boot2 <- suppressWarnings(
boot_lucid(G = G, Z = Z, Y = Y_normal, lucid_model = "early",
model = fit1, R = 5, conf = 0.9)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.