Process tracing estimator
process_tracing_estimator.Rd
Draw conclusions from a model given a query, data, and process tracing strategies
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")
#> Loading required namespace: CausalQueries
#>
#> Causal queries generated by query_model
#>
#> |term |XY | estimate|
#> |:----|:----|--------:|
#> |X-Y |X1Y1 | 0.5|
#>
# 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"))
#>
#> Causal queries generated by query_model
#>
#> |term |XY | estimate|
#> |:-----|:----|--------:|
#> |Y |X1Y1 | 0.111|
#> |X-Y |X1Y1 | 0.200|
#> |X-M-Y |X1Y1 | 0.000|
#>