set_confounds_df {CausalQueries} | R Documentation |
Normally a confounds_df is added to a model whenever confounding is set. The confounds_df can be manually provided however using set_confounds_df.
set_confounds_df(model)
model |
A |
An object of class causal_model
. It essentially returns a list containing the elements comprising
a model (e.g. 'statement', 'nodal_types' and 'DAG') with the confound_df attached to the parameter matrix in the model.
model <- make_model('X -> Y') %>% set_confound(list('X <-> Y'), add_confounds_df = FALSE) model$confounds_df set_confounds_df(model)$confounds_df # An example where a restriction is applied after a confounding relation is set removes model <- make_model('X -> Y') %>% set_confound(list(X = '(Y[X=1] > Y[X=0])')) %>% set_restrictions('(Y[X=1] > Y[X=0])')