Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
salbalkus committed Feb 13, 2025
1 parent 0f38723 commit 3636ee0
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![JOSS Status](https://joss.theoj.org/papers/68c43e832d063050a4e67528191e8148/status.svg)](https://joss.theoj.org/papers/68c43e832d063050a4e67528191e8148)

*A common interface for storing and simulating data for causal inference in Julia.*
*A common interface for processing and simulating data for causal inference in Julia.*

[Causal inference](https://en.wikipedia.org/wiki/Causal_inference) is the process of estimating, from data, the effect of a treatment variable on an outcome variable -- typically in the presence of confounders. The goal of `CausalTables.jl` is to simplify the development of statistical causal inference methods in Julia. To this end, the package provides two sets of tools:

Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CausalTables.jl

*A common interface for storing and simulating data for causal inference in Julia.*
*A common interface for processing and simulating data for causal inference in Julia.*

## Overview

Expand Down
2 changes: 1 addition & 1 deletion docs/src/man/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ In addition, the `CausalTable` object has several utility functions that can be
# Additional utility functions for CausalTables
treatment(ctbl) # get CausalTable of treatment variables
response(ctbl) # get CausalTable of response variables
treatmentparents(ctbl) # get CausalTable of treatment and response
treatmentparents(ctbl) # get CausalTable of treatment and response
responseparents(ctbl) # get CausalTable of treatment and confounders
parents(ctbl, :NOX) # get CausalTable of parents of a particular variable
Expand Down
3 changes: 0 additions & 3 deletions docs/src/man/generating-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ In the above, the keys of `causes` denote the variables whose causes are being s

`causes` must be specified manually unless the user is assuming that all unlabeled variables cause both `treatment` and `outcome`. This is the default assumption of a `StructuralCausalModel`, but it may not not factually match the model encoded by the `DataGeneratingProcess`. This behavior is allowed for two reasons: (1) to permit a random draw of a `CausalTable` with an 'incorrect' causal model, which can be useful for benchmarking the robustness of different causal inference methods to model misspecification, and (2) to simulate causal models that implicitly condition on a particular set of variables by leaving them out of the `causes` argument. Otherwise, ensure that labels in `causes` do not contradict the data generating process!

Finally, in some cases it may be convenient to define intermediate variables within a DGP


## Networks of Causally-Connected Units

In some cases, we might work with data in which units may *not* be causally independent, but rather, in which one unit's variables could dependent on some summary function of its neighbors. Generating data from such a model can be done by adding lines of the form `Xs $ NetworkSummary` to the `@dgp` macro.
Expand Down
1 change: 0 additions & 1 deletion docs/src/man/ground-truth.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ To evaluate the causal effects of continuous treatments, one can apply the `addi
Once we've defined an SCM (see [Generating data for statistical experiments](generating-data.md)) and have some table of intervened data with variables matching those of our DGP, we can compute the ground truth conditional distributions of any variable (given a corresponding DGP) using the `condensity` function. For any line starting with a `~` in the DGP, `condensity` will be able to return the true conditional distribution, a Distribution object from the package [Distributions.jl](https://juliastats.org/Distributions.jl/stable/), given the data. Some examples are shown below:

```jldoctest truthtest; output = false, filter = r"(?<=.{18}).*"s
# Distribution of the treatment in the observed data
A_distribution = condensity(scm, ct, :A)
Expand Down
24 changes: 4 additions & 20 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ authors:
name: Nima S. Hejazi
orcid: 0000-0002-7127-2789
bibliography: paper.bib
date: 6 February 2025
date: 13 February 2025
tags:
- Julia
- statistics
- causal inference
- tables
title: "CausalTables.jl: Simulating and storing data for statistical
title: "CausalTables.jl: Simulating and processing data for statistical
causal inference in Julia"
toc-title: Table of contents
---
Expand Down Expand Up @@ -148,7 +148,7 @@ with each draw depending on the draws preceding it. For example:

`\begin{align*}
W &\sim Beta(2, 4) \\
A &\sim Bernoulli(W) \\
A &\sim Bernoulli(0.5W + 0.2) \\
Y &\sim Normal(A + W, 1)
\end{align*}`{=tex}

Expand Down Expand Up @@ -181,28 +181,12 @@ For instance, computing an ATE compares hypothetical responses had
everyone been treated versus no one treated; one can apply these
interventions on a `CausalTable` using the `intervene` function:

:::: {.cell execution_count="1"}
::: {.cell execution_count="1"}
``` {.julia .cell-code}
treated = intervene(ct, treat_all)
untreated = intervene(ct, treat_none)
```

::: {.cell-output .cell-output-display execution_count="1"}
CausalTable
┌─────────┬─────────┬─────────┐
│ W │ A │ Y │
│ Float64 │ Float64 │ Float64 │
├─────────┼─────────┼─────────┤
│ 0.4 │ 0.0 │ 2.0 │
│ 0.3 │ 0.0 │ 1.1 │
│ 0.2 │ 0.0 │ 3.3 │
│ 0.2 │ 0.0 │ -1.3 │
│ 0.4 │ 0.0 │ -1.0 │
└─────────┴─────────┴─────────┘
Summaries: NamedTuple()
Arrays: NamedTuple()
:::
::::

After simulating data, the true ("oracle") distribution can be obtained
using `condensity`. Other functions obtain specific features, such as
Expand Down
7 changes: 4 additions & 3 deletions paper/paper.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "CausalTables.jl: Simulating and storing data for statistical causal inference in Julia"
title: "CausalTables.jl: Simulating and processing data for statistical causal inference in Julia"
tags:
- Julia
- statistics
Expand All @@ -16,7 +16,7 @@ authors:
affiliations:
- name: Department of Biostatistics, Harvard T.H. Chan School of Public Health
index: 1
date: 6 February 2025
date: 13 February 2025
bibliography: paper.bib
format: markdown
engine: julia
Expand Down Expand Up @@ -76,7 +76,7 @@ An SCM defines causal structure by envisaging a data-generating process as rando

\begin{align*}
W &\sim Beta(2, 4) \\
A &\sim Bernoulli(W) \\
A &\sim Bernoulli(0.5W + 0.2) \\
Y &\sim Normal(A + W, 1)
\end{align*}

Expand Down Expand Up @@ -104,6 +104,7 @@ ct = rand(scm, 5) # randomly sample
Many causal estimands involve applying some intervention to a treatment. For instance, computing an ATE compares hypothetical responses had everyone been treated versus no one treated; one can apply these interventions on a `CausalTable` using the `intervene` function:

```{julia}
#| output: false
treated = intervene(ct, treat_all)
untreated = intervene(ct, treat_none)
```
Expand Down

0 comments on commit 3636ee0

Please sign in to comment.