# Parallel Types

`DiffinDiffsBase.TrendOrUnspecifiedPR`

— Type`TrendOrUnspecifiedPR{C,S}`

Union type of `TrendParallel{C,S}`

and `UnspecifiedParallel{C,S}`

.

`DiffinDiffsBase.AbstractParallel`

— Type`AbstractParallel{C<:ParallelCondition, S<:ParallelStrength}`

Supertype for all parallel types.

`DiffinDiffsBase.Approximate`

— Type`Approximate <: ParallelStrength`

Supertype for all types assuming some notion of parallel holds approximately.

`DiffinDiffsBase.CovariateConditional`

— Type`CovariateConditional <: ParallelCondition`

Supertype for all types assuming some notion of parallel holds after conditioning on covariates.

`DiffinDiffsBase.Exact`

— Type`Exact <: ParallelStrength`

Assume some notion of parallel holds exactly.

`DiffinDiffsBase.NeverTreatedParallel`

— Type`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`

.

`DiffinDiffsBase.NotYetTreatedParallel`

— Type`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`

.

`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`

— Type`ParallelCondition`

Supertype for all types imposing conditions of parallel.

`DiffinDiffsBase.ParallelStrength`

— Type`ParallelStrength`

Supertype for all types specifying the strength of parallel.

`DiffinDiffsBase.TrendParallel`

— Type`TrendParallel{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`

— Type`Unconditional <: ParallelCondition`

Assume some notion of parallel holds without conditions.

`DiffinDiffsBase.UnspecifiedParallel`

— Type`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**

`c::C`

: an instance of`ParallelCondition`

.`s::S`

: an instance of`ParallelStrength`

.

`DiffinDiffsBase.exact`

— Method`exact()`

Alias for `Exact()`

.

`DiffinDiffsBase.istreated`

— Function`istreated(pr::TrendParallel, x)`

Test whether `x`

represents the treatment time for a group of units that are not treated. See also `istreated!`

.

`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`

.

`DiffinDiffsBase.nevertreated`

— Method```
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
```

`DiffinDiffsBase.notyettreated`

— Method```
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
```

`DiffinDiffsBase.unconditional`

— Method`unconditional()`

Alias for `Unconditional()`

.

`DiffinDiffsBase.unspecifiedpr`

— Function`unspecifiedpr(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`

.