Description Usage Arguments Value Examples
View source: R/make_data_probabilities.R
NOTE: This needs to be checked for whether it is taking account of strategy probabilities properly
1 | make_data_probabilities(model, pars, possible_data)
|
model |
A causal model as created by |
given |
A data frame with observations |
subset |
data strategy |
A dataset
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(dplyr)
model <- make_model("X->M->Y") %>%
set_restrictions(causal_type_restrict = "Y[M=1]<Y[M=0] | M[X=1]<M[X=0] ") %>%
set_parameter_matrix()
model <- set_parameters(model, type = "flat")
possible_data <- make_possible_data(model, N= 2)
make_data_probabilities(model, pars = model$parameters, possible_data)
given <- data.frame(X = c(0,0,0,1,1,1), M = NA, Y = c(0,0,1,0,1,1)) %>%
collapse_data(model)
possible_data <- make_possible_data(model, given = given, condition = "X==1 & Y==1", vars = "M", within = TRUE )
make_data_probabilities(model, pars = model$parameters, possible_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.