Parallel Types

DiffinDiffsBase.NeverTreatedParallelType
NeverTreatedParallel{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 of ParallelCondition.
  • s::S: an instance of ParallelStrength.
source
DiffinDiffsBase.NotYetTreatedParallelType
NotYetTreatedParallel{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 in e started to receive treatment or show anticipation effects.
  • c::C: an instance of ParallelCondition.
  • s::S: an instance of ParallelStrength.
Note

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.
source
DiffinDiffsBase.TrendParallelType
TrendParallel{C,S} <: AbstractParallel{C,S}

Supertype for all parallel types that assume a parallel trends assumption holds over all the relevant time periods.

source
DiffinDiffsBase.UnspecifiedParallelType
UnspecifiedParallel{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

source
DiffinDiffsBase.istreated!Function
istreated!(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.

source
DiffinDiffsBase.nevertreatedMethod
nevertreated(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
source
DiffinDiffsBase.notyettreatedMethod
notyettreated(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
source