Network Summaries
In network causal inference, methods often rely on summarizing the treatment and covariates of each unit's neighbors using some sort of summary function. For example, in a study evaluating the effect of electric vehicle adoption on air pollution, one might model the commuting patterns between counties as a network and evaluate the effect of the sum the number of electric vehicles commuting into each county. More information on when one might want to construct a CausalTable that features summary functions is featured in Turning Your Data Into a CausalTable
.
This section documents all available summary measures and how to summarize them within a CausalTable.
Summarizing a CausalTable
Data wrapped in a CausalTable includes a NamedTuple summaries
which describes extra variables represented as summary variables over the network. These summary measures can be computed and added to the table by calling the summarize
function on the CausalTable object.
CausalTables.summarize
— Functionsummarize(o::CausalTable)
Summarizes the data in a CausalTable
object according to the NetworkSummary objects stored in its summaries
attribute.
Arguments
o::CausalTable
: TheCausalTable
object to be summarized.
Returns
- A new
CausalTable
object with the original data merged with the summarized data.
Existing Summary Measures
The following lists summary measures currently available off-the-shelf in CausalTables.jl. Examples on their use are provided in Generating Data for Statistical Experiments and Turning data into a CausalTable
.
CausalTables.Sum
— TypeSum <: NetworkSummary
A NetworkSummary which sums the values of the target variable for each unit connected in the adjacency matrix
of a StructuralCausalModel
or CausalTable
Fields
target::Symbol
: A key denoting the target variable to be summarized in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the target variable to be summarized in thedata
attribute of aCausalTable
.matrix::Symbol
: A key denoting the adjacency matrix over which summary is computed in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the key of the adjacency matrix in thearrays
attribute of aCausalTable
.weights::Union{Symbol, Nothing}
: An optional variable by which each unit may be weighted in the summary.
CausalTables.Mean
— TypeMean <: NetworkSummary
A NetworkSummary which computes the mean of the target variable among each unit connected in the adjacency matrix
.
Fields
target::Symbol
: A key denoting the target variable to be summarized in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the target variable to be summarized in thedata
attribute of aCausalTable
.matrix::Symbol
: A key denoting the adjacency matrix over which summary is computed in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the key of the adjacency matrix in thearrays
attribute of aCausalTable
.weights::Union{Symbol, Nothing}
: An optional variable by which each unit may be weighted in the summary.
CausalTables.AllOrderStatistics
— TypeAllOrderStatistics <: NetworkSummary
A NetworkSummary which computes all ordered values of the target variable among each unit's connected neighbors in the adjacency matrix
.
Fields
target::Symbol
: A key denoting the target variable to be summarized in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the target variable to be summarized in thedata
attribute of aCausalTable
.matrix::Symbol
: A key denoting the adjacency matrix over which summary is computed in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the key of the adjacency matrix in thearrays
attribute of aCausalTable
.weights::Union{Symbol, Nothing}
: An optional variable by which each unit may be weighted in the summary.
CausalTables.KOrderStatistics
— TypeKOrderStatistics <: NetworkSummary
A NetworkSummary which computes the top K ordered values of the target variable among each unit's connected neighbors in the adjacency matrix
.
Fields
target::Symbol
: A key denoting the target variable to be summarized in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the target variable to be summarized in thedata
attribute of aCausalTable
.matrix::Symbol
: A key denoting the adjacency matrix over which summary is computed in theDataGeneratingProcess
of theStructuralCausalModel
; or, alternatively, the key of the adjacency matrix in thearrays
attribute of aCausalTable
.weights::Union{Symbol, Nothing}
: An optional variable by which each unit may be weighted in the summary.
Defining Your Own Summary Measures
Forthcoming.