@@ -45,27 +45,48 @@ required(::CheckData) = (:data,)
4545default (:: CheckData ) = (subset= nothing , weightname= nothing )
4646
4747"""
48- groupterms(args... )
48+ grouptreatintterms(treatintterms )
4949
50- Return the arguments for allowing later comparisons based on object-id.
51- See also [`GroupTerms `](@ref).
50+ Return the argument without change for allowing later comparisons based on object-id.
51+ See also [`GroupTreatintterms `](@ref).
5252"""
53- groupterms (treatintterms:: TermSet , xterms:: TermSet ) =
54- (treatintterms = treatintterms, xterms = xterms)
53+ grouptreatintterms (treatintterms:: TermSet ) = (treatintterms= treatintterms,)
5554
5655"""
57- GroupTerms <: StatsStep
56+ GroupTreatintterms <: StatsStep
5857
59- Call [`DiffinDiffsBase.groupterms `](@ref)
60- to obtain one of the instances of `treatintterms` and `xterms`
61- that have been grouped by `==`
58+ Call [`DiffinDiffsBase.grouptreatintterms `](@ref)
59+ to obtain one of the instances of `treatintterms`
60+ that have been grouped by equality (`hash`)
6261for allowing later comparisons based on object-id.
6362
6463This step is only useful when working with [`@specset`](@ref) and [`proceed`](@ref).
6564"""
66- const GroupTerms = StatsStep{:GroupTerms , typeof (groupterms ), false }
65+ const GroupTreatintterms = StatsStep{:GroupTreatintterms , typeof (grouptreatintterms ), false }
6766
68- required (:: GroupTerms ) = (:treatintterms , :xterms )
67+ default (:: GroupTreatintterms ) = (treatintterms= TermSet (),)
68+
69+ """
70+ groupxterms(xterms)
71+
72+ Return the argument without change for allowing later comparisons based on object-id.
73+ See also [`GroupXterms`](@ref).
74+ """
75+ groupxterms (xterms:: TermSet ) = (xterms= xterms,)
76+
77+ """
78+ GroupXterms <: StatsStep
79+
80+ Call [`DiffinDiffsBase.groupxterms`](@ref)
81+ to obtain one of the instances of `xterms`
82+ that have been grouped by equality (`hash`)
83+ for allowing later comparisons based on object-id.
84+
85+ This step is only useful when working with [`@specset`](@ref) and [`proceed`](@ref).
86+ """
87+ const GroupXterms = StatsStep{:GroupXterms , typeof (groupxterms), false }
88+
89+ default (:: GroupXterms ) = (xterms= TermSet (),)
6990
7091function _checkscales (col1:: AbstractArray , col2:: AbstractArray , treatvars:: Vector{Symbol} )
7192 if col1 isa ScaledArrOrSub || col2 isa ScaledArrOrSub
@@ -159,11 +180,12 @@ Exclude rows with missing data or violate the overlap condition
159180and find rows with data from treated units.
160181See also [`CheckVars`](@ref).
161182"""
162- function checkvars! (data, tr :: AbstractTreatment , pr:: AbstractParallel ,
183+ function checkvars! (data, pr:: AbstractParallel ,
163184 yterm:: AbstractTerm , treatname:: Symbol , esample:: BitVector , aux:: BitVector ,
164- treatintterms:: TermSet , xterms:: TermSet )
185+ treatintterms:: TermSet , xterms:: TermSet , :: Type , @nospecialize (trvars:: Tuple ),
186+ tr:: AbstractTreatment )
165187 # Do not check eltype of treatintterms
166- treatvars = union ([treatname], termvars (tr) , termvars (pr))
188+ treatvars = union ([treatname], trvars , termvars (pr))
167189 checktreatvars (tr, pr, treatvars, data)
168190
169191 allvars = union (treatvars, termvars (yterm), termvars (xterms))
@@ -202,9 +224,40 @@ Call [`DiffinDiffsBase.checkvars!`](@ref) to exclude invalid rows for relevant v
202224"""
203225const CheckVars = StatsStep{:CheckVars , typeof (checkvars!), true }
204226
205- required (:: CheckVars ) = (:data , :tr , :pr , :yterm , :treatname , :esample , :aux )
206- default (:: CheckVars ) = (treatintterms= TermSet (), xterms= TermSet ())
207- copyargs (:: CheckVars ) = (6 ,)
227+ required (:: CheckVars ) = (:data , :pr , :yterm , :treatname , :esample , :aux ,
228+ :treatintterms , :xterms )
229+ transformed (:: CheckVars , @nospecialize (nt:: NamedTuple )) =
230+ (typeof (nt. tr), (termvars (nt. tr)... ,))
231+
232+ combinedargs (step:: CheckVars , allntargs) =
233+ combinedargs (step, allntargs, typeof (allntargs[1 ]. tr))
234+
235+ combinedargs (:: CheckVars , allntargs, :: Type{DynamicTreatment{SharpDesign}} ) =
236+ (allntargs[1 ]. tr,)
237+
238+ copyargs (:: CheckVars ) = (5 ,)
239+
240+ """
241+ groupsample(esample)
242+
243+ Return the argument without change for allowing later comparisons based on object-id.
244+ See also [`GroupSample`](@ref).
245+ """
246+ groupsample (esample:: BitVector ) = (esample= esample,)
247+
248+ """
249+ GroupSample <: StatsStep
250+
251+ Call [`DiffinDiffsBase.groupsample`](@ref)
252+ to obtain one of the instances of `esample`
253+ that have been grouped by equality (`hash`)
254+ for allowing later comparisons based on object-id.
255+
256+ This step is only useful when working with [`@specset`](@ref) and [`proceed`](@ref).
257+ """
258+ const GroupSample = StatsStep{:GroupSample , typeof (groupsample), false }
259+
260+ required (:: GroupSample ) = (:esample ,)
208261
209262"""
210263 makeweights(args...)
0 commit comments