run_experiment {R6causal} | R Documentation |
Conduct a sequence of interventions and collect the simulated data.
Description
Conduct a sequence of interventions and collect the simulated data.
Usage
run_experiment(scm, intervene, response, n)
Arguments
scm |
An SCM object |
intervene |
A list where the names of the elements are the variables to be intervened and the values of the elements are vectors specifying the values set in the intervention |
response |
A vector of the names of the response variables |
n |
Size of the data to be simulated for each intervention |
Value
A list containing the values of the response variables for all intervention combinations
Examples
backdoor_experiment <- run_experiment(backdoor,
intervene = list(x = c(0,1)),
response = "y",
n = 10000)
colMeans(backdoor_experiment$response_list$y)
[Package R6causal version 0.8.3 Index]