CausalQueries1.1.1 package

Make, Update, and Query Binary Causal Models

observe_data

Observe data, given a strategy

check_args

helper to check arguments

check_query

Warn about improper query specification and apply fixes

check_string_input

Check string_input

clean_condition

Clean condition

clean_param_vector

Clean parameter vector

clean_params

Check parameters sum to 1 in param_set; normalize if needed; add names...

default_stan_control

default_stan_control

draw_causal_type

Draw a single causal type given a parameter vector

drop_empty_families

Drop empty families

expand_data

Expand compact data object to data frame

expand_nodal_expression

Helper to expand nodal expression

expand_wildcard

Expand wildcard

find_rounding_threshold

helper to find rounding thresholds for print methods

print.model_query

Print a tightened summary of model queries

print.nodal_types

Print a short summary for causal_model nodal-types

print.nodes

Print a short summary for causal_model nodes

print.parameter_mapping

Print a short summary for paramater mapping matrix

print.parameters

Print a short summary for causal_model parameters

print.parameters_df

Print a short summary for a causal_model parameters data-frame

print.parameters_posterior

Print a short summary for causal_model parameter posterior distributio...

print.parameters_prior

Print a short summary for causal_model parameter prior distributions

print.parents_df

Print a short summary for a causal_model parents data-frame

print.posterior_event_probabilities

Print a short summary of posterior_event_probabilities

print.stan_summary

Print a short summary for stan fit

print.statement

Print a short summary for a causal_model statement

print.type_distribution

Print a short summary for causal-type posterior distributions

print.type_prior

Print a short summary for causal-type prior distributions

prior_setting

Setting priors

queries_to_types

helper to get types from queries

query_distribution

Calculate query distribution

add_dots

Helper to fill in missing do operators in causal expression

add_wildcard

Adds a wildcard for every missing parent

causal_type_names

Names for causal types

CausalQueries-package

'CausalQueries'

CausalQueries_internal_inherit_params

Create parameter documentation to inherit

collapse_data

Make compact data with data strategies

collapse_nodal_types

collapse nodal types

complements

Make statement for complements

construct_commands_alter_at

make_par_values

construct_commands_other_args

make_par_values

construct_commands_param_names

make_par_values

data_to_data

helper to generate a matrix mapping from names of M to names of A

data_type_names

Data type names

decreasing

Make monotonicity statement (negative)

make_data

Make data

make_data_single

Generate full dataset

make_events

Make data in compact form

make_model

Make a model

make_nodal_types

Make nodal types

make_par_values

make_par_values

make_par_values_stops

make_par_values_stops

make_parameter_matrix

Make parameter matrix

make_parameters_df

function to make a parameters_df from nodal types

make_parmap

Make parmap: a matrix mapping from parameters to data types

make_prior_distribution

Make a prior distribution from priors

minimal_data

Creates a data frame for case with no data

minimal_event_data

Creates a compact data frame for case with no data

n_check

n_check

nodes_in_statement

Identify nodes in a statement

non_decreasing

Make monotonicity statement (non negative)

non_increasing

Make monotonicity statement (non positive)

parameter_setting

Setting parameters

parents_to_int

Helper to turn parents_list into a list of data_realizations column po...

perm

Produces the possible permutations of a set of nodes

plot_model

Plots a DAG in ggplot style using a causal model input

prep_stan_data

Prepare data for 'stan'

print.causal_model

Print a short summary for a causal model

print.causal_types

Print a short summary for causal_model causal-types

print.dag

Print a short summary for a causal_model DAG

print.event_probabilities

Print a short summary for event probabilities

query_model

Generate estimands dataframe

query_to_expression

Helper to turn query into a data expression

realise_outcomes

Realise outcomes

restrict_by_labels

Reduce nodal types using labels

restrict_by_query

Reduce nodal types using statement

reveal_outcomes

Reveal outcomes

set_ambiguities_matrix

Set ambiguity matrix

update_model

Fit causal model using 'stan'

update_causal_types

Update causal types based on nodal types

set_confound

Set confound

set_parameter_matrix

Set parameter matrix

set_parmap

Set parmap: a matrix mapping from parameters to data types

set_prior_distribution

Add prior distribution draws

set_restrictions

Restrict a model

set_sampling_args

set_sampling_args From 'rstanarm' (November 1st, 2019)

simulate_data

simulate_data is an alias for make_data

st_within

Get string between two regular expression patterns

substitutes

Make statement for substitutes

summarise_distribution

helper to compute mean and sd of a distribution data.frame

summary.causal_model

Summarizing causal models

te

Make treatment effect statement (positive)

type_matrix

Generate type matrix

uncollapse_nodal_types

uncollapse nodal types

unpack_wildcard

Unpack a wild card

get_prior_distribution

Get a prior distribution from model

get_query_types

Look up query types

get_type_distributions

helper to get type distributions

get_type_names

Get type names

get_type_prob

Get type probabilities

get_type_prob_c

generates one draw from type probability distribution for each type in...

get_type_prob_multiple

Draw matrix of type probabilities, before or after estimation

get_type_prob_multiple_c

generates n draws from type probability distribution for each type in ...

grab

Grab

gsub_many

Recursive substitution

increasing

Make monotonicity statement (positive)

interacts

Make statement for any interaction

interpret_type

Interpret or find position in nodal type

is_a_model

Check whether argument is a model

list_non_parents

Returns a list with the nodes that are not directly pointing into a no...

make_ambiguities_matrix

Make ambiguities matrix

get_all_data_types

Get all data types

get_ambiguities_matrix

Get ambiguities matrix

get_causal_types

Get causal types

get_data_families

get_data_families

get_estimands

helper to get estimands

get_event_probabilities

Draw event probabilities

get_nodal_types

Get list of types for nodes in a DAG

get_param_dist

Get a distribution of model parameters

get_parameter_matrix

Get parameter matrix

get_parameter_names

Get parameter names

get_parents

Get list of parents of all nodes in a model

get_parmap

Get parmap: a matrix mapping from parameters to data types

get_posterior_distribution

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>).

  • Maintainer: Till Tietz
  • License: MIT + file LICENSE
  • Last published: 2024-04-26