Treatment Terms
DiffinDiffsBase.TermSet
— TypeTermSet <: AbstractSet{AbstractTerm}
Wrapped Set{AbstractTerm}
that specifies a collection of terms. Commonly used methods for Set
work in the same way for TermSet
.
Compared with StatsModels.TermOrTerms
, it does not maintain order of terms but is more suitable for dynamically constructed terms.
DiffinDiffsBase.TermSet
— MethodTermSet([itr])
TermSet(ts::Union{Int, Symbol, AbstractTerm}...)
Construct a TermSet
from a collection of terms. Instead of passing an iterable collection, one may pass the terms as arguments directly. In the latter case, any Int
or Symbol
will be converted to a Term
. See also termset
, which is an alias for the constructor.
DiffinDiffsBase.TreatmentTerm
— TypeTreatmentTerm{T<:AbstractTreatment} <: AbstractTerm
A term that contains specifications on treatment and parallel trends assumption. See also treat
.
Fields
sym::Symbol
: the column name of data representing treatment status.tr::T
: a treatment type that specifies the causal parameters of interest.pr::P
: a parallel type that specifies the parallel trends assumption.
DiffinDiffsBase.parse_intercept!
— Methodparse_intercept(ts::TermSet)
Remove any ConstantTerm
or InterceptTerm
and return Boolean values indicating whether terms explictly requiring including/excluding the intercept exist.
This function is useful for obtaining a unique way of specifying the intercept before going through the schema
–apply_schema
pipeline defined in StatsModels
.
DiffinDiffsBase.termset
— Methodtermset([itr])
termset(ts::Union{Int, Symbol, AbstractTerm}...)
Construct a TermSet
from a collection of terms. Instead of passing an iterable collection, one may pass the terms as arguments directly. In the latter case, any Int
or Symbol
will be converted to a Term
.
DiffinDiffsBase.treat
— Methodtreat(s::Symbol, t::AbstractTreatment, p::AbstractParallel)
Construct a TreatmentTerm
with fields set by the arguments.