View source: R/model_extractors.R
| get_selected_G | R Documentation |
Reads model$select$selectG (or, for a serial model, stage 1's own
selection), auto-detecting the model type from class(model). Stage
1 is the only stage in a serial chain whose "G" is the cohort's actual
exposures – from stage 2 on, "G" is the previous stage's posterior
cluster probabilities, so there is nothing there for an exposure-selection
result to describe (see estimate_lucid's @return for
the full rationale). This is exactly the same field estimate_lucid()
already returns; this function only adds the class-based dispatch and the
union/per-layer/per-stage bookkeeping so a caller doesn't have to.
get_selected_G(model, layer = NULL)
model |
A fitted |
layer |
For a parallel model only: which layer's own exposure
selection to return (an integer index or a layer name). If |
A named logical vector, one entry per exposure, TRUE where
retained.
idx <- 1:200
G <- sim_data$G[idx, ]
Z <- sim_data$Z[idx, ]
Y_normal <- sim_data$Y_normal[idx, ]
fit <- estimate_lucid(G = G, Z = Z, Y = Y_normal, lucid_model = "early",
family = "normal", K = 2, Rho_G = 0.1,
max_itr = 10, max_tot.itr = 30)
get_selected_G(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.