Getting Started with Crumble.jl

Crumble.jl targets mediation problems where direct and indirect effects may be estimated flexibly with machine learning.

This page keeps the examples lightweight for documentation purposes. The code is shown in the same structure you would use in real analyses.

Setup

Example: Binary Treatment and Binary Mediator

print(result)
CrumbleResult
  Effect type: N

Estimates:
  Direct Effect                              0.0008 (SE:   1.2327) [95% CI:  -2.4153,   2.4169]
  Average Treatment Effect                  -0.0004 (SE:   1.2338) [95% CI:  -2.4187,   2.4179]
  Indirect Effect                           -0.0012 (SE:   1.2336) [95% CI:  -2.4191,   2.4168]

Tidy Output

Crumble.tidy(result)
3×6 DataFrame
Rowestimandestimatestd_errorconf_lowconf_highp_value
StringFloat64Float64Float64Float64Float64
1direct0.0007977181.23272-2.415332.416920.999484
2ate-0.0003830041.23382-2.418672.41790.999752
3indirect-0.001180721.23365-2.419132.416760.999236

Use print(result) for the formatted summary and tidy(result) when you want a DataFrame for downstream reporting.