Make, Update, and Query Binary Causal Models
Observe data, given a strategy
helper to check arguments
Warn about improper query specification and apply fixes
Check string_input
Clean condition
Clean parameter vector
Check parameters sum to 1 in param_set; normalize if needed; add names...
default_stan_control
Draw a single causal type given a parameter vector
Drop empty families
Expand compact data object to data frame
Helper to expand nodal expression
Expand wildcard
helper to find rounding thresholds for print methods
Print a tightened summary of model queries
Print a short summary for causal_model nodal-types
Print a short summary for causal_model nodes
Print a short summary for paramater mapping matrix
Print a short summary for causal_model parameters
Print a short summary for a causal_model parameters data-frame
Print a short summary for causal_model parameter posterior distributio...
Print a short summary for causal_model parameter prior distributions
Print a short summary for a causal_model parents data-frame
Print a short summary of posterior_event_probabilities
Print a short summary for stan fit
Print a short summary for a causal_model statement
Print a short summary for causal-type posterior distributions
Print a short summary for causal-type prior distributions
Setting priors
helper to get types from queries
Calculate query distribution
Helper to fill in missing do operators in causal expression
Adds a wildcard for every missing parent
Names for causal types
'CausalQueries'
Create parameter documentation to inherit
Make compact data with data strategies
collapse nodal types
Make statement for complements
make_par_values
make_par_values
make_par_values
helper to generate a matrix mapping from names of M to names of A
Data type names
Make monotonicity statement (negative)
Make data
Generate full dataset
Make data in compact form
Make a model
Make nodal types
make_par_values
make_par_values_stops
Make parameter matrix
function to make a parameters_df from nodal types
Make parmap: a matrix mapping from parameters to data types
Make a prior distribution from priors
Creates a data frame for case with no data
Creates a compact data frame for case with no data
n_check
Identify nodes in a statement
Make monotonicity statement (non negative)
Make monotonicity statement (non positive)
Setting parameters
Helper to turn parents_list into a list of data_realizations column po...
Produces the possible permutations of a set of nodes
Plots a DAG in ggplot style using a causal model input
Prepare data for 'stan'
Print a short summary for a causal model
Print a short summary for causal_model causal-types
Print a short summary for a causal_model DAG
Print a short summary for event probabilities
Generate estimands dataframe
Helper to turn query into a data expression
Realise outcomes
Reduce nodal types using labels
Reduce nodal types using statement
Reveal outcomes
Set ambiguity matrix
Fit causal model using 'stan'
Update causal types based on nodal types
Set confound
Set parameter matrix
Set parmap: a matrix mapping from parameters to data types
Add prior distribution draws
Restrict a model
set_sampling_args From 'rstanarm' (November 1st, 2019)
simulate_data is an alias for make_data
Get string between two regular expression patterns
Make statement for substitutes
helper to compute mean and sd of a distribution data.frame
Summarizing causal models
Make treatment effect statement (positive)
Generate type matrix
uncollapse nodal types
Unpack a wild card
Get a prior distribution from model
Look up query types
helper to get type distributions
Get type names
Get type probabilities
generates one draw from type probability distribution for each type in...
Draw matrix of type probabilities, before or after estimation
generates n draws from type probability distribution for each type in ...
Grab
Recursive substitution
Make monotonicity statement (positive)
Make statement for any interaction
Interpret or find position in nodal type
Check whether argument is a model
Returns a list with the nodes that are not directly pointing into a no...
Make ambiguities matrix
Get all data types
Get ambiguities matrix
Get causal types
get_data_families
helper to get estimands
Draw event probabilities
Get list of types for nodes in a DAG
Get a distribution of model parameters
Get parameter matrix
Get parameter names
Get list of parents of all nodes in a model
Get parmap: a matrix mapping from parameters to data types
Get the posterior distribution from a model
Users can declare binary causal models, update beliefs about causal types given data and calculate arbitrary estimands. Model definition makes use of 'dagitty' functionality. Updating is implemented in 'stan'. The approach used in 'CausalQueries' is a generalization of the 'biqq' models described in "Mixing Methods: A Bayesian Approach" (Humphreys and Jacobs, 2015, <DOI:10.1017/S0003055415000453>). The conceptual extension makes use of work on probabilistic causal models described in Pearl's Causality (Pearl, 2009, <DOI:10.1017/CBO9780511803161>).