process_tracing_estimator: Process tracing estimator

View source: R/helpers-process-tracing.R

process_tracing_estimatorR Documentation

Process tracing estimator

Description

Draw conclusions from a model given a query, data, and process tracing strategies

Usage

process_tracing_estimator(causal_model, query, data, strategies)

Arguments

causal_model

a model generated by CausalQueries

query

a causal query of interest

data

a single row dataset with data on nodes in the model

strategies

a vector describing sets of nodes to be examined e.g. c("X", "X-Y")

Details

See https://book.declaredesign.org/observational-causal.html#process-tracing

Value

a data.frame of estimates

Examples

# Simple example showing ambiguity in attribution
process_tracing_estimator(
  causal_model = CausalQueries::make_model("X -> Y"),
  query = "Y[X=1] > Y[X=0]",
  data = data.frame(X=1, Y = 1),
  strategies = "X-Y")

# Example where M=1 acts as a hoop test
process_tracing_estimator(
  causal_model = CausalQueries::make_model("X -> M -> Y") |>
   CausalQueries::set_restrictions("Y[M=1] < Y[M=0]") |>
   CausalQueries::set_restrictions("M[X=1] < M[X=0]"),
  query = "Y[X=1] > Y[X=0]",
  data = data.frame(X=1, Y = 1, M = 0),
  strategies = c("Y", "X-Y", "X-M-Y"))

rdss documentation built on Oct. 11, 2024, 1:08 a.m.