View source: R/mcee_helper_nuisance_config.R
| mcee_config_maker | R Documentation |
mcee_general()Creates a configuration list describing **how to obtain a nuisance function**
used by mcee_general. You may either:
supply **known values** (bypasses learning), or
specify a **learning method** (e.g., GLM/GAM/RF/Ranger/SL) with a formula.
mcee_config_maker(
target,
method = NULL,
formula = NULL,
family = NULL,
known = NULL,
known_a1 = NULL,
known_a0 = NULL,
clipping = NULL,
SL.library = NULL,
...
)
target |
Character; which nuisance to configure. One of
|
method |
Optional character learner name when *not* using known values.
Supported:
Ignored if any of |
formula |
RHS-only formula describing predictors for the learner
(used when |
family |
Optional GLM/GAM family. If |
known |
Optional numeric scalar/vector of **known values** for the nuisance.
Commonly used for |
known_a1, known_a0 |
Optional numeric scalar/vector providing known values
for the treatment-specific versions of a nuisance (e.g., |
clipping |
Optional numeric vector of length 2, |
SL.library |
Character vector of SuperLearner libraries (only used
when |
... |
Reserved for future extensions; currently ignored. |
If any of known, known_a1, or known_a0 is provided,
the returned configuration is of type “known” and **no learner will be fit**.
Otherwise, the configuration records the requested learner, formula, family,
optional clipping, and (for SL) the library.
Internally, helper validators ensure method is supported and
clipping (if provided) is sane. Family defaults are chosen when
family = NULL for GLM/GAM methods.
A named list describing the configuration. For known configs:
list( nuisance_parameter = <target>, known = <numeric or NULL>, known_a1 = <numeric or NULL>, known_a0 = <numeric or NULL>, clipping = <numeric length-2 or NULL> )
For learner configs:
list( nuisance_parameter = <target>, method = <character>, formula = <formula or NULL>, family = <family or NULL>, clipping = <numeric length-2 or NULL>, SL.library = <character vector; only when method == "sl"> )
mcee_general,
helper constructors like
mcee_config_known(),
mcee_config_glm(),
mcee_config_gam(),
mcee_config_lm(),
mcee_config_rf(),
mcee_config_ranger(),
mcee_config_sl(),
mcee_config_sl_user().
# Known p (MRT randomization), GLM for other nuisances
cfg_p <- mcee_config_maker("p", known = 0.5)
cfg_q <- mcee_config_maker("q", method = "glm", formula = ~ dp + M)
cfg_eta <- mcee_config_maker("eta", method = "glm", formula = ~dp)
cfg_mu <- mcee_config_maker("mu", method = "glm", formula = ~ dp + M)
cfg_nu <- mcee_config_maker("nu", method = "glm", formula = ~dp)
# SuperLearner with default library (set explicitly if you prefer)
# cfg_q_sl <- mcee_config_maker("q", method = "sl", formula = ~ dp + M,
# SL.library = c("SL.mean","SL.glm","SL.ranger"))
# Known treatment-specific outcome regressions (e.g., from external source)
# cfg_eta_known <- mcee_config_maker("eta", known_a1 = rep(1, 100),
# known_a0 = rep(0, 100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.