View source: R/model-design-tools.R
enw_add_pooling_effect | R Documentation |
This function adds a pooling effect to the metadata
returned by enw_effects_metadata()
. It does this updating the
fixed
column to 0 for the effects that match the string
argument and
adding a new column var_name
that is 1 for the effects that match the
string
argument and 0 otherwise.
enw_add_pooling_effect(effects, var_name = "sd", finder_fn = startsWith, ...)
effects |
A
This is the output of |
var_name |
The name of the new column that will be added to the
|
finder_fn |
A function that will be used to find the effects that
match the string. Defaults to |
... |
Additional arguments to |
A data.table
with the following columns:
effects: the name of the effect
fixed: a logical indicating whether the effect is fixed (1) or random (0).
Argument supplied to var_name
: a logical indicating whether the effect
should be pooled (1) or not (0).
Functions used to formulate models
enw_add_cumulative_membership()
,
enw_design()
,
enw_effects_metadata()
,
enw_one_hot_encode_feature()
data <- data.frame(a = 1:3, b = as.character(1:3), c = c(1,1,2))
design <- enw_design(a ~ b + c, data)$design
effects <- enw_effects_metadata(design)
enw_add_pooling_effect(effects, prefix = "b")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.