Parallel Types
DiffinDiffsBase.TrendOrUnspecifiedPR
— TypeTrendOrUnspecifiedPR{C,S}
Union type of TrendParallel{C,S}
and UnspecifiedParallel{C,S}
.
DiffinDiffsBase.AbstractParallel
— TypeAbstractParallel{C<:ParallelCondition, S<:ParallelStrength}
Supertype for all parallel types.
DiffinDiffsBase.Approximate
— TypeApproximate <: ParallelStrength
Supertype for all types assuming some notion of parallel holds approximately.
DiffinDiffsBase.CovariateConditional
— TypeCovariateConditional <: ParallelCondition
Supertype for all types assuming some notion of parallel holds after conditioning on covariates.
DiffinDiffsBase.Exact
— TypeExact <: ParallelStrength
Assume some notion of parallel holds exactly.
DiffinDiffsBase.NeverTreatedParallel
— TypeNeverTreatedParallel{C,S} <: TrendParallel{C,S}
Assume a parallel trends assumption holds between any group that received the treatment during the sample periods and a group that did not receive any treatment in any sample period. See also nevertreated
.
Fields
e::Tuple{Vararg{ValidTimeType}}
: group indices for units that did not receive any treatment.c::C
: an instance ofParallelCondition
.s::S
: an instance ofParallelStrength
.
DiffinDiffsBase.NotYetTreatedParallel
— TypeNotYetTreatedParallel{C,S} <: TrendParallel{C,S}
Assume a parallel trends assumption holds between any group that received the treatment relatively early and any group that received the treatment relatively late (or never receved). See also notyettreated
.
Fields
e::Tuple{Vararg{ValidTimeType}}
: group indices for units that received the treatment relatively late.ecut::Tuple{Vararg{ValidTimeType}}
: user-specified period(s) when units in a group ine
started to receive treatment or show anticipation effects.c::C
: an instance ofParallelCondition
.s::S
: an instance ofParallelStrength
.
ecut
could be different from minimum(e)
if
- never-treated groups are included and use indices with smaller values;
- the sample has a rotating panel structure with periods overlapping with some others.
DiffinDiffsBase.ParallelCondition
— TypeParallelCondition
Supertype for all types imposing conditions of parallel.
DiffinDiffsBase.ParallelStrength
— TypeParallelStrength
Supertype for all types specifying the strength of parallel.
DiffinDiffsBase.TrendParallel
— TypeTrendParallel{C,S} <: AbstractParallel{C,S}
Supertype for all parallel types that assume a parallel trends assumption holds over all the relevant time periods.
DiffinDiffsBase.Unconditional
— TypeUnconditional <: ParallelCondition
Assume some notion of parallel holds without conditions.
DiffinDiffsBase.UnspecifiedParallel
— TypeUnspecifiedParallel{C,S} <: AbstractParallel{C,S}
A parallel trends assumption (PTA) without explicitly specified relations across treatment groups. See also unspecifiedpr
.
With this parallel type, operations for complying with a PTA are suppressed. This is useful, for example, when the user-provided regressors and sample restrictions need to be accepted without any PTA-specific alteration.
Fields
c::C
: an instance ofParallelCondition
.s::S
: an instance ofParallelStrength
.
DiffinDiffsBase.exact
— Methodexact()
Alias for Exact()
.
DiffinDiffsBase.istreated
— Functionistreated(pr::TrendParallel, x)
Test whether x
represents the treatment time for a group of units that are not treated. See also istreated!
.
DiffinDiffsBase.istreated!
— Functionistreated!(out::AbstractVector{Bool}, pr::TrendParallel, x::AbstractArray)
For each element in x
, test whether it represents the treatment time for a group of units that are not treated and save the result in out
. See also istreated
.
DiffinDiffsBase.nevertreated
— Methodnevertreated(e, c::ParallelCondition, s::ParallelStrength)
nevertreated(e; c=Unconditional(), s=Exact())
Construct a NeverTreatedParallel
with fields set by the arguments. By default, c
is set as Unconditional()
and s
is set as Exact()
. When working with @formula
, a wrapper method of nevertreated
calls this method.
Examples
julia> nevertreated(-1)
Parallel trends with any never-treated group:
Never-treated groups: -1
julia> typeof(nevertreated(-1))
NeverTreatedParallel{Unconditional,Exact}
julia> nevertreated([-1, 0])
Parallel trends with any never-treated group:
Never-treated groups: -1, 0
julia> nevertreated([-1, 0]) == nevertreated(-1:0) == nevertreated(Set([-1, 0]))
true
DiffinDiffsBase.notyettreated
— Methodnotyettreated(e, ecut, c::ParallelCondition, s::ParallelStrength)
notyettreated(e, ecut=e; c=Unconditional(), s=Exact())
Construct a NotYetTreatedParallel
with fields set by the arguments. By default, c
is set as Unconditional()
and s
is set as Exact()
. When working with @formula
, a wrapper method of notyettreated
calls this method.
Examples
julia> notyettreated(5)
Parallel trends with any not-yet-treated group:
Not-yet-treated groups: 5
Treated since: 5
julia> typeof(notyettreated(5))
NotYetTreatedParallel{Unconditional,Exact}
julia> notyettreated([-1, 5, 6], 5)
Parallel trends with any not-yet-treated group:
Not-yet-treated groups: -1, 5, 6
Treated since: 5
julia> notyettreated([4, 5, 6], [4, 5, 6])
Parallel trends with any not-yet-treated group:
Not-yet-treated groups: 4, 5, 6
Treated since: 4, 5, 6
DiffinDiffsBase.unconditional
— Methodunconditional()
Alias for Unconditional()
.
DiffinDiffsBase.unspecifiedpr
— Functionunspecifiedpr(c::ParallelCondition=Unconditional(), s::ParallelStrength=Exact())
Construct an UnspecifiedParallel
with fields set by the arguments. This is an alias of the inner constructor of UnspecifiedParallel
.