Changelog
Source:NEWS.md
Version 1.56.18.9000
Breaking changes
The minimum supported R version is now 4.4.0, raised from 4.1.0 (#427). The previous floor had never been tested. 4.4.0 is the oldest R for which CRAN offers an installable
Matrix, a hard dependency offetwfe. Users on R 4.3.2 or 4.3.3, whose bundledMatrix(1.6-1.1 and 1.6-5 respectively) already satisfiesfetwfe’s constraint, could install until now and are the ones this change affects. Continuous integration now runs the package’s checks on the declared minimum, so it is verified rather than asserted.A fit whose variance invariant is broken now errors where it used to succeed (#470).
fetwfe(),etwfe(),betwfe()andtwfeCovs()fail at call time when a diagonal entry of the simultaneous band’s joint covariance falls below-1, and a fit where only the event-study family is affected still returns but then fails whenprint(),summary()orplot()renders its band. Both previously returned a silently degraded interval — see the bug fix below. Such a fit can still be obtained withci_type = "pointwise", which skips the simultaneous band entirely, and the error message says so. Underoptions(warn = 2)the threshold is not-1but-1e-10: the warning tier fires there, and because the band helpers deliberately re-raise that warning outside their own error handling,warn = 2converts it into an error that propagates. Nothing changes on well-conditioned data, where no tier fires at all.A fit whose cohort-probability variance is catastrophically negative now errors where it used to return (#474). This is the same bound as the previous item, applied to the other half of the variance:
fetwfe(),etwfe(),betwfe()andtwfeCovs()fail at call time when the cohort-probability variance — the piece contributed by estimating, rather than knowing, each treated cohort’s share of the units — falls below-1, andeventStudy(),print(),summary(),plot()andsimultaneousCIs()fail the same way on the routes that reach it. Unlike the previous item this bound also lands onse_type = "default"withci_type = "pointwise", the one combination that had no fit-blocking variance diagnostic at all. Only the simultaneous-band site’s error names a way to obtain a fit anyway; at the other three there is no argument that skips the calculation, so the message says nothing it cannot deliver. Nothing changes on well-conditioned data, where no tier fires at all.A fit serialized by a released version is no longer readable by every method, and the failure is not uniform across the classes (#460). The new
catt_band_appliedslot is required by the class validators, exactly asci_typehas been since 1.16.0, so an object saved by an older version is missing it. Measured, per class and per method: onfetwfeandbetwfe,print(),summary(),eventStudy(),tidy()andplot()all raisemalformed <class> object. Missing slot(s): catt_band_applied. OntwfeCovsonlytidy()raises it —eventStudy()andplot()refuse the class rather than the slot, andprint()andsummary()do not raise at all, because those two run no validator. An oldtwfeCovsfit whose band genuinely applied therefore prints[pointwise 95% CI]over a real simultaneous band, silently. That is the conservative direction — the label understates the coverage rather than overstating it — but it is a silent relabel and not an error. Refit rather than reload; there is no migration for a serialized object.fetwfe()andbetwfe()estimates no longer depend on the units of the response (#428). Both fit the bridge penalty withgrpreg, whose lambda grid and absolute thresholddeltatogether made the estimate depend on the response’s units; either can return the null model for a response whose values are very small, and atq > 1the grid can for very large ones. Both estimators now divide the GLS-transformed response by the noise standard deviation, the square root ofsig_eps_sq(estimated or supplied), before the fit and scale the coefficients back, on both the cross-validation and BIC routes. Multiplying the response by anyc > 0, and a supplied variance byc^2, now multiplies every estimate, standard error and interval bound byc. The reported lambda values stay in the response’s units, and on the BIC route a suppliedlambda.maxwithoutadd_ridgegives the same fit as before, except wheredeltahad distorted the old fit. Because asig_eps_sqsupplied together withsig_eps_c_sqnow also sets where the lambda grid sits, a variance supplied in the wrong units can move the estimates, not only their standard errors.fetwfe(gls = FALSE)fits, which estimate no noise variance, are not standardized and still depend on the units (#490). Theq = 1nuisance behinddebiasedATT()and the high-dimensional bootstrap band ofsimultaneousCIs()is standardized too, by the response’s standard deviation, so it no longer depends on the units either. Existing estimates move.add_ridge = TRUEno longer inflates the estimates of a response with large values (#428). The ridge penalty was proportional to the variance components, so it grew with the square of the response’s scale, and the estimators then multiply their coefficients by one plus that penalty. For a response with large values,fetwfe(),betwfe(),etwfe()andtwfeCovs()returned inflated estimates and distorted standard errors, increasingly so as the values grew, andfetwfe()could fail with agrpregconvergence error. The penalty is now unit-free.Cross-validated
fetwfe()andbetwfe()estimates can move, at the defaultcv_seedand at any other (#524): their cross-validation folds, and those of the high-dimensional bootstrap band ofsimultaneousCIs(), are now drawn over an order of the units computed from the data rather than from their sorted IDs, so relabeling the units no longer changes which penalty cross-validation selects, except through REML’s small dependence on unit order when the noise variances are estimated (#535).debiasedATT()anddebiasedATTWithSimulatedData()were withheld from the exported API; #527 tracks their re-export.eventStudy()andsimultaneousCIs(family = "event_study")omit event times no cohort reaches, rather than reporting an estimate of 0 there, so ase_type = "conservative"band withoutindep_countsno longer counts them (#515).simultaneousCIs(family = "cohort")labels each cohort by its time value, astidy()does, not by its period position (#506).etwfe()returns class"fetwfe_etwfe"instead of"etwfe", so loading fetwfe no longer changes how the etwfe package’s fits print, summarize, tidy or plot;inherits(fit, "etwfe")isFALSEfor new fits,etwfe()fits saved by earlier versions lose fetwfe’s methods and must be refit, and the method help topics are renamed, for example to?tidy.fetwfe_etwfe(#523).
Defensive improvements
A negative cohort-probability variance is no longer discarded in silence (#474). The variance of a treatment-effect estimate is the sum of two pieces, and the second — the variance inherited from estimating each treated cohort’s share of the units — is non-negative in exact arithmetic but can come out negative in floating point. Three internal sites clipped such a value to zero and reported nothing: the overall-ATT variance for
fetwfe(), the same quantity foretwfe(),betwfe()andtwfeCovs(), and the cohort-probability block of the simultaneous band. All three now carry the same two-tier diagnostic the cluster-sandwich sites have carried since version 1.11.2: a negative at the scale of floating-point cancellation is still clipped silently, a larger one warns and names the site, the value and the offending index, and one below-1is an error. The estimates themselves are unchanged. See the breaking change above for what a fit that hits the error tier now does.Several errors raised from inside the package now say something useful (#431). A bad
T,G,d,densityoreff_sizepassed togenCoefs()orgenCoefsCore()prints the message on its own, instead of prefixing it with the name of an internal validator and a list of formal names that are not the values you supplied. A failed internal assertion inside the treatment-effect machinery now names the function that failed; previously it reported an anonymous function and pasted every argument’s value into the error, so the printed message ran past a million characters and a caller who captured the condition withtryCatch()held on to roughly half a megabyte of matrices. Three latent hazards became loud rather than silent: two internal size helpers reject a non-scalar or non-numeric argument instead of returning a wrong count, the cross-validation helper checks that the penalty index it selected really is the one cross-validation chose instead of quietly substituting the nearest, and the standard-error recomputation helper requires a usable message before it can fail with an empty one. Finally, the “standard errors will not be calculated” message emitted when the Gram matrix on the selected features is singular is now stored once and read by all three places that emit it, so the copies cannot drift apart.An out-of-range seed now fails with the package’s own message, at every door (#440).
set.seed()can represent only a 32-bit signed integer, so a larger magnitude previously produced base R’sNAs introduced by coercion to integer rangewarning followed by an opaquesupplied seed is not a valid integererror — neither of which names the offending argument or states the limit. Every argument that carries a seed into the random-number generator is now range-checked against+/- .Machine$integer.maxand reports, for example,seed must be within +/- .Machine$integer.max (2147483647); got 3000000000. The covered arguments areseedonsimulateData(),simulateDataCore(),genCoefs(), andgenCoefsCore();cv_seedonfetwfe()andbetwfe()(and their*WithSimulatedData()wrappers), which now fails during input validation alongside any other bad argument in the same call instead of part-way through the fit at the cross-validation fold seeding; andBandseedonsimultaneousCIs(method = "bootstrap")anddebiasedATT(method = "bootstrap"). An out-of-rangeBpreviously becameNA_integer_and surfaced several frames later as the crypticvector size cannot be NA. The boundary is strict, so exactly.Machine$integer.maxis still accepted. On the four data-generation doors,NULL/NA/NaNstill mean “draw from the ambient generator”, and this is a range check only — a non-integral seed such as1.5is still truncated silently byset.seed(), as before;cv_seedand the bootstrapB/seedreject those values as they always have. The one input that used to work and no longer does is a non-integral magnitude between.Machine$integer.maxand2147483648(2147483647.9, say), which previously truncated to2147483647Land drew from a different seed than the one supplied.A high-dimensional simultaneous band that is really the post-selection fallback now says so (#433). When the full design is high-dimensional (
p >= NT), only one route returns a uniformly valid band: afetwfe()fit undermethod = "bootstrap", the desparsified construction. Every other combination falls back to the fixed-pselected-support band, which a coverage study (#308) measures at roughly 0.09 against 0.95 nominal even when the selected support is low-dimensional.simultaneousCIs()andeventStudy()now emit a warning naming the applicable remedy on every such call — previously onlysimultaneousCIs(method = "bootstrap")on a non-fetwfe()fit did, leaving the analytic default, which is the route users actually take, and afetwfe()fit on that default, silent.print()andsummary()note it in their output, under the CATT preview, for the interactive reader who sees the band on screen rather than extracting it. The warning carries the condition class"fetwfe_highdim_postselection_band", so it can be caught or muffled precisely withwithCallingHandlers()rather than by matching its text; fitting withci_type = "simultaneous"stays silent, andprint()/summary()/plot()do not repeat it on every render. No estimate, band, standard error, or selected support changes; what changes is that a result already known to be unreliable is now announced.genCoefs()andgenCoefsCore()no longer spin forever on a legal but degeneratedensity(#436): selecting the nonzero coefficients is rejection sampling whose expected number of attempts grows without bound asdensityapproaches 0, so a value such as1e-300— which the argument checks accept — previously never returned, with no message and no error, and the retry is now capped at 10,000 attempts and fails with a message naming the attempt count, the coefficient-vector length and thedensitysupplied.simulateData()andsimulateDataCore()no longer spin forever at the smallestNtheir argument checks admit (#436): allocatingNunits amongG + 1groups is also rejection sampling, and atN = G + 1every group must receive exactly one unit, which happens with probability 4.8e-13 atG = 30, so the draw is now capped at 1,000,000 attempts and fails with a message namingN,G, the per-group bar it could not clear, the attempt count and the way out — at smallG, increasingNby about 25% takes the expected number of draws from hundreds of thousands or millions to under 200, though the headroom needed grows withG.Some
simulateData()calls that used to succeed now error instead (#436). No cap can serve every admissibleN, and the retry cost near the smallest admissible sizes is a smooth distribution rather than a clean split between workable and hopeless — so bounding it necessarily cuts off the slowest successes along with the calls that never finish. Measured over ten seeds atG = 14,T = 15,d = 1,N = 15— the default mode, noguarantee_rank_condition— ten of ten succeeded before, in a median of 0.96 seconds, and eight of ten succeed now. The same happens at theguarantee_rank_condition = TRUEsizes. If asimulateData()call nearN = G + 1orN = (G + 1)(d + 1)starts failing, raiseN: this is the cost of never hanging, and the error names the way out.A missing value passed to
genCoefs()orgenCoefsCore()now names the argument at fault (#436). A typedNAsuch asNA_real_orNA_integer_, andNaN, satisfyis.numeric(), so all five ofT,G,d,densityandeff_sizeslipped past the argument checks; for the first four the comparison that followed evaluated toNAand R raisedmissing value where TRUE/FALSE needed, whileeff_size— whose check makes no comparison — passed validation outright and failed later inside the coefficient assembly. What these functions accept is unchanged: every such input already failed, just without saying which argument was at fault.Given a fit from the etwfe package,
eventStudy(),cohortStudy(),cohortTimeATTs()andsimultaneousCIs()raise an error naming its class and the functions a fit must come from, instead of reporting missing slots and asking for an issue (#523).
Bug fixes
print()andsummary()no longer label a confidence-interval previewsimultaneouswhen no simultaneous band was applied (#460). Both preview headers were labeled from the fit’sci_typeslot, which records the argument the user passed and not what the band construction actually produced, so a fit whose band came backNULL— including one whose reported bounds are allNA— announced a family-wise coverage guarantee that the displayed intervals do not have. Fitted objects now carry a new logical slotcatt_band_applied, recording whether the fit-time cohort-family band was written intocatt_df, and the data frameeventStudy()returns carries the logical attributeattr(., "band_applied")for its own family; each preview header is labeled from the signal belonging to the family it describes. The two are separate because the two bands are built from different contrast matrices over the same covariance and fail independently. One visible consequence beyond the failure case: on an ordinary fit whose cohort band applies while its event-study band was never requested — which happens whenever the bridge selects nothing on the event-study support — the event-study preview header now reads[pointwise 95% CI]where it previously read[simultaneous 95% CI]. That header was wrong before and is right now; the intervals under it have not changed.ci_typeitself is unchanged, and still reports what was requested. The high-dimensional post-selection caveat introduced in #433 is still rendered on ap >= N*Tfit whose band was not applied — the pointwise intervals shown there still under-cover — but it now describes those intervals rather than a band that does not exist.eventStudy()on afetwfe()fit no longer returnsNaNor an understated standard error when the per-event-time cohort-probability variance goes negative (#474). That quantity was the one place in the family with no floor at all — its ETWFE and BETWFE counterpart has floored the same quantity since version 1.11.0, but does so inside a shared helper, so the two routes looked identical from the caller. A negative therefore reachedsqrt()and producedNaN; underse_type = "conservative"it producedNaNfor any negative, however small, because that branch takes the square root of a product of the two variance pieces; and when the regression piece was large enough to keep the sum positive, the reported standard error was silently too small, with noNaNto notice. The value is now floored at zero and diagnosed like every other member of the family, so the affected event times report the standard error implied by the regression piece alone rather than a wrong number or none. Estimates are unchanged, as are standard errors on well-conditioned data.A broken variance invariant on the simultaneous-confidence-band path no longer passes silently (#470). The joint covariance behind
simultaneousCIs()andeventStudy()floored its diagonal at zero with no signal, so a negative variance — impossible in exact arithmetic, since the cluster-robust sandwich is a sum of outer products — returned a confidence interval collapsed to a point at the estimate. Left as they were, the internal routes that fit a band duringfetwfe()/etwfe()/betwfe()/twfeCovs()and duringprint()/summary()/plot()would have swallowed the new signal as well: a failure inside the band construction degrades there to the pointwise interval under a[simultaneous 95% CI]header — a narrower interval, so it would have over-rejected. That fallback is deliberate and is unchanged for an ordinary error; what is new is that the two conditions described next are classed, so those routes let exactly those two through instead of absorbing them. Those floors now carry the same two-tier diagnostic the scalar cluster-sandwich sites have carried since version 1.11.2: negatives at the scale of floating-point cancellation are still clipped silently, a larger one warns, and one below-1is an error, with one aggregated condition per call naming the offending effects and the most negative value. The estimates themselves are unchanged, and nothing changes on well-conditioned data, where no tier fires at all. See the breaking change above for what a fit that hits the error tier now does.The simultaneous bands of a fit’s
catt_df(and so ofcohortStudy()), ofeventStudy()(and so ofprint(),summary()andplot()) and ofsimultaneousCIs()narrowed toward, and at small enough values fell back to, the pointwise band, withNAadjusted p-values and no warning, for a response with small values, and no longer do (#489).Under
se_type = "conservative"withoutindep_counts,simultaneousCIs()gave a finite adjusted p-value to a custom contrast whose variance is only rounding error, which weights that cancel across cells the bridge fused to one value can leave; it now givesNA, as the defaultse_typeandmethod = "bootstrap"already did (#489).In
simultaneousCIs(), a"custom"family whose rows’ weights were very small, or differed in size by a large factor, lost its simultaneous band or some adjusted p-values, because those rows counted as zero-variance; each row is now judged relative to its own weights (#501).debiasedATT()now builds its fixed-p (p < NT) debiasing direction from the centered design, as the paper specifies, so when that centered design has full rank its estimate is the unrestricted ETWFE (OLS) estimate of the overall ATT up to its numerical ridge, as documented; its standard errors and intervals change too (#507).plot(type = "catt")stopped withDiscrete values supplied to continuous scaleunderggplot23.5.x on a fit without standard errors, such as afetwfe()orbetwfe()fit withq >= 1or afetwfe(gls = FALSE)fit, and now plots it, including such a fit saved before this change;ggplot24.0.3 was not affected (#505). On such fits made with this version, these,ci_lowandci_highcolumns ofcatt_dfand ofcohortStudy(), andtidy()’sstd.error, are numericNArather than logicalNA; a saved fit keeps the types it was stored with.eventStudy(),simultaneousCIs(),cohortTimeATTs()and the fit-time cohort band are right on panels whose time codes do not step by 1, such as biennial, gapped or YYYYMM codes (#506).The max-T adjusted p-values of the analytic simultaneous bands (
simultaneousCIs()$adjusted_p_values, and thecatt_dfandeventStudy()p-values underci_type = "simultaneous") no longer fall below the pointwise p-value or above its Bonferroni bound, and those bands’ critical value stays between the pointwise and the Bonferroni critical values (#551).
Internal
The remaining six items of the test-power audit that followed the #400/#401 single-sourcing campaign now have coverage, closing #429. Six classes of mutation to shipped code are now caught by the test file that claims the contract, where before they were invisible to it — entirely so for five of the six, and for nine of the sixteen argument checks in the sixth: deleting the shared C6/C8 dimension check from the
etwfe,betwfeortwfeCovsvalidator; three separate defects in the internal helper that computes the in-sample and independent ATT pair; flipping the flag that keeps an ordinary fit silent when the bridge penalty zeroes every treatment effect in the high-dimensional regime; adding, removing or reordering a column of the degenerate confidence-band data frame; dropping thedrop = FALSEthat keeps a single-column selection matrix a matrix on thefetwfebranch; and weakening any of the sixteen scalar argument checks thatgenCoefs()andgenCoefsCore()share.simultaneousCIs()’s own standard-error path also gained an absolute pinned value on each of the cross-accessor guardrail’s six fixtures, so it no longer rests only on agreement with the other accessors — an agreement a further consolidation would hollow, exactly as the #400 fold already hollowed the anchors before it. Tests only: no file underR/is touched and no estimator behavior changes.Eight small defects found by a late audit of the #400/#401 single-sourcing work are fixed together (#431). Two of them finish that campaign: the pre-treatment column-count formula, which an earlier off-by-one bug had already been traced to, is now read from its single owner at the last two places that still re-derived it inline, and the three sites that deliberately re-derive it as a cross-check say so in a comment. The C6 dimension contract checks shared by the
etwfe,betwfeandtwfeCovsvalidators now read every slot exactly rather than by prefix, so a malformed object can no longer match a differently-named slot and pass a check it should fail. Neither changes any result: the estimators return numerically identical output on both the simulated and the real-data examples.The high-dimensional nodewise (desparsified-lasso) solve is now single-sourced in one internal primitive shared by
debiasedATT()and both simultaneous-band bootstrap channels, so the point estimate and the bands cannot drift apart on the penalty scale or the convergence diagnostics (#366).The five rendering pieces shared by
print()andprint(summary())— the standard-error qualifier, the simultaneous-versus-pointwise band label, the overall-ATT Wald interval, the truncated-preview block, and the Model Details block — are each now emitted from one place instead of being written twice, so an edit to one report can no longer land without the other (#439). Printed output is unchanged: byte-identity was verified across 28 renderings spanning all four estimator classes, both report paths, everyse_typeandci_type, and all four truncation footers. The Wald-interval helper is shared withbroom::tidy()’sconf.intcolumns.twfeCovsgained the print and summary snapshot tests it had never had, and the"pointwise","cluster-robust"and"conservative"labels are now pinned on both report paths. The one behavior change is on malformed input: aModel Detailsblock whose dimension fields are missing orNULLnow raises a named error instead of silently omitting the affected row, which in practice is reachable only from asummary()object saved by a release predating the internalR->Grename.The range rule above and its error wording are single-sourced in two new internal helpers in
R/utility.R,.exceeds_integer_max()and.format_int_max_range(), so the boundary cannot later be tightened in one copy only and the value-formatting guards cannot be applied to some sites but not others (#440).simultaneousCIs()anddebiasedATT()now report theBerror ahead of theseederror when both arguments are invalid, because the newBrange check precedes the pre-existing whole-number check onseed. Previously a call with an out-of-rangeBand a non-integralseedreported theseedmessage (#440).The four
*WithSimulatedData()wrappers no longer repeat thematch.arg()calls their estimator cores already perform — nine deletions acrossse_type,ci_type, andfusion_structure— so each of those arguments is validated in exactly one place. Abbreviations still resolve (se_type = "conserv"still yields"conservative"). One user-visible consequence: when bothsimulated_objandse_typeare invalid, the reported error is now thesimulated_objone rather than these_typeone (#440).The error
simultaneousCIs()raises on a singular Gram matrix is now written once instead of twice (#429). The live text and the test that pins it were two hand-kept copies of the same sentence, so rewriting the live one left the whole test suite green. The shared internal constant is named for the analytic method, because the bootstrap path raises a different error and this one’s advice — switch tomethod = "bootstrap"— would be wrong there. The guardrail on the shared standard-error scaffold also regained the detection power it lost when that scaffold was consolidated: absolute standard errors are now pinned on all six of its fixtures rather than two, and the policy thateventStudy()andcohortTimeATTs()reportNAstandard errors wheresimultaneousCIs()raises an error is asserted at those three functions rather than only at the internal helper behind them. No estimator behavior changes.Every pull request and every push to
mainnow runsR CMD check --as-cranon six operating-system and R-version combinations — macOS, Windows, and Ubuntu on R release, plus Ubuntu ondevel,oldrel-1, andoldrel-2— where previously the package was checked on one machine only (#427). A NOTE fails the build, matching the local gate.The first run of that matrix found four assertions in
tests/testthat/test-gls-kronecker-block-apply-165.Rthat required the block-apply GLS transform to agree with an explicit-Kronecker reference exactly, and they now allow round-off instead (#427). The two sides are mathematically equal but are different sequences of floating-point operations, so bit-identity between them is a property of the linear-algebra library rather than of correctness: the assertions passed on macOS and Windows and failed on all four Linux jobs, by 1 to 4 units in the last place (max absolute difference 4.44e-16 on values of order 1). This corrects the claim in the 1.10.0 entry for #165 that the identity was “verified bit-identical (16-digit parity)”. No estimator behavior changed.
Version 1.56.18
Defensive improvements
- Defense-in-depth hardening (#403). Six latent robustness fixes, one per bullet below, plus one documented acceptance that needed no behavior change — none reachable as a live bug through the shipped entry points, but each a trap for future changes or unusual-but-legal inputs:
-
getBetaBIC()(thelambda_selection = "bic"path) now floors the residual MSE at.Machine$double.eps * var(y)and warns when a lambda interpolates the response, instead of producingBIC = -Inf(which would win the selection unconditionally, ignoring model size). The floor is relative to the response’s own scale, so it is invariant to the units ofy. -
getGramInv()no longer drops its selected-treatment Gram sub-matrix to a scalar when a single treatment feature is selected, so its dimension assertions actually check that degenerate case. -
simultaneousCIs(method = "bootstrap")now reports an actionable “not invertible” error (instead of a bare LAPACK error) when the centered Gram on the selected support is singular, and carries the underlying error text along with it. - The internal propensity influence-function helper’s cohort-count guard now actually rejects a non-integral
N * cohort_probs_overall(the previous condition was a tautology and never fired). The helper is shared bysimultaneousCIs(method = "bootstrap")anddebiasedATT(method = "bootstrap"), and its error now names whichever of the two you called. -
augment()no longer requires the unusedcovsslot, so a hand-built or legacy fit carryingcovs = NULLis accepted. (A covariate-freed = 0fit from the shipped entry points storescharacter(0)and was already accepted.) - The internal expected-cohort-probability helper validates its
distributionargument before seeding, so an invaliddistributioncombined with a non-NULLseed no longer advances the caller’s random-number stream before erroring (the counterpart of the #399 seed-before-validation fix). The validation now goes throughmatch.arg()(the package idiom), so the argument also accepts unambiguous partial matches —"gauss"resolves to"gaussian"— where it previously required an exact string.
-
Version 1.56.17
New features
simultaneousCIs()gains acv_time_budgetargument (defaultInf) — the same wall-clock backstopdebiasedATT()already offered (#384). Underlambda_c = "cv"it caps the cross-validation that selects the high-dimensional (p >= NT) nodewise penalty, falling back to the theory scale (lambda_c = 1.0) with a warning if the budget fires, so an adversarial high-dimensional draw cannot spin indefinitely through the band path. Whenlambda_c = "cv"the band object now also carries$lambda_cv(the cross-validation diagnostics), matchingdebiasedATT(). (#402)debiasedATT(method = "bootstrap")now supportsindep_counts(two-sample) fits, which it previously refused. The wild bootstrap perturbs the cohort-weight channel on its own independent multiplier stream over the reconstructed count-sample units (sum(indep_counts) == Nis enforced), reproducing the two-sample propensity variance — the identical constructionsimultaneousCIs()already ran on such fits. The default analytic SE is unchanged. (#402)
Version 1.56.16
Bug fixes
-
processFactors()(used when afetwfe()/etwfe()/betwfe()/twfeCovs()fit includes factor covariates) now names the dummy columns with the documentedfactorVar_levelNamescheme (e.g.group_B), instead of leaking the internalmodel.matrixterm label (e.g.group_pdata[[v]]B). This corrects the constructed design-matrix column names (colnames(fit$internal$X_ints)); the returned coefficient vector is unnamed, sosummary()/coef()output is unchanged. (#399) -
genCoefs()/simulateData()no longer advance the caller’s ambient random-number stream when they reject an invalid argument. Seeding is now applied only after all argument validation succeeds, so a call that errors (e.g. an invalidT,G, ordensity) leaves.Random.seeduntouched. (#399)
Version 1.56.15
Bug fixes
-
attgtToFetwfeDf()/etwfeToFetwfeDf()no longer emit a spurious “unit(s) switch from treated back to untreated” warning. The check measured only the input data frame’s row order (a treated-to-untreated reversal is impossible by construction, since the first-treatment period is constant within a unit), so it fired falsely on valid time-descending input; it has been removed. These converters also now accept a first-treatment period ofInf(a common never-treated encoding), mapping it to0instead of erroring with a misleading “Missing values” message. - The estimator input validator now reports a named, actionable violation for a missing (
NA) value in the response or time column (previously anNAresponse surfaced as a bare internalall(!is.na(data)) is not TRUE), and for a mixed-NAindep_countsvector (previously “missing value where TRUE/FALSE needed”). (#397)
Version 1.56.14
Bug fixes
-
etwfe()andtwfeCovs()now report an informative error when the design is rank-deficient for a reason other than a small cohort (e.g. perfectly collinear covariates, wherelm()returnsNAfor the aliased column), instead of the opaqueall(!is.na(beta_hat_slopes)) is not TRUEassertion. The message names the cause and points to dropping the redundant covariate(s) or settingadd_ridge = TRUE. -
twfeCovs()no longer refuses fits with fewer thand + 1units in some cohort. Thatd + 1-per-cohort rank condition is a requirement of the full ETWFE design (its cohort-by-covariate interaction blocks), not of the collapsed designtwfeCovs()fits, so small-cohort covariate fits — a coretwfeCovs()use case (e.g. single-state cohorts) — now succeed, with valid standard errors where the collapsed design is full rank. The gate is retained foretwfe(), whose full design genuinely needs it. (#395)
Version 1.56.13
Bug fixes
-
eventStudy()andplot()now reject an invalidalpha(outside(0, 1),NA, or non-scalar) instead of silently returning inverted confidence intervals (qnorm(1 - alpha/2)is negative oncealpha >= 1). A shared internal guard now backs every confidence-interval accessor (eventStudy(),cohortTimeATTs(),debiasedATT(),simultaneousCIs(), andplot()), so they all reject a badalphawith the same message.simultaneousCIs()likewise now validates itsriesz_max_iter/riesz_tolnodewise controls, matchingdebiasedATT(). -
plot(type = "catt")now orders the cohort axis numerically rather than alphabetically. Previously, for panels whose adoption times cross a digit-width boundary, cohorts2, 3, ..., 10, 11rendered in string order (10, 11, 2, ...). (#396)
Version 1.56.12
Bug fixes
-
getTes()gained adistributionargument (default"gaussian") so the propensity-weighted ground truth (att_true,cohort_weights, andactual_event_time_tes) integratesE[pi_g(X)]over the covariate distribution the panel was actually simulated from. Previously the integration was always over a Gaussian X, so asimulateData(distribution = "uniform")panel with covariate-dependent cohort assignment reported a truth integrated over the wrong distribution (an ~0.7% ATT gap in that cell). Pass the samedistributiontogetTes()that you passed tosimulateData(); the default preserves the previous (Gaussian) output for every existing call. (#398)
Version 1.56.11
Bug fixes
-
genFullInvFusionTransformMat()— the standalone full inverse-fusion basis matrix — built its three covariate-interaction blocks (cohort x X, time x X, treatment x X) with the wrong Kronecker order (feature-majorI_d (x) blockinstead of the package’s level-majorblock (x) I_d), so it disagreed with the authoritativeuntransformCoefImproved()ford >= 2. The only estimator path that consumes this builder is the ridge augmentation, sofetwfe(add_ridge = TRUE)withd >= 2covariates was penalizing a coordinate-permuted coefficient vector rather than the documented untransformed coefficients. Fixed; affected fits shift by a small numeric amount (~1e-7at the defaultlambda_ridge, growing withlambda_ridge).add_ridge = FALSEfits,debiasedATT(), and the simultaneous-band paths are byte-identical. (#394)
Version 1.56.10
Bug fixes
-
simultaneousCIs(method = "bootstrap")now floors theK >= 2sup-t critical value and its dual single-step max-T adjusted p-value at the pointwise Gaussian value (qnorm(1 - alpha/2)and2 * pnorm(-|t|)). Under strong cross-effect correlation the raw Monte-Carlo estimate of either could dip below the pointwise value, returning a “simultaneous” band strictly inside its own pointwise band (or an adjusted p-value smaller than the pointwise p) — anti-conservative in the one quantity a simultaneous band exists to guarantee. Flooring both restores “simultaneous never narrower / more significant than pointwise” and keeps the band / adjusted-p duality exact. Mirrors the scalar wild-bootstrap floor (#363) and theK <= 1branch. (#393)
Version 1.56.9
Internal
- Folded the previously-triplicated event-time point-estimate aggregation (
tau_E(e) = sum_{g in V_e} w_g * cell(g, e)) into the shared internal helper.true_event_time_effects();eventStudy()forfetwfe,etwfe, andbetwfenow computes its point estimates through that single source (#389).eventStudy()output is byte-identical to before. Because the helper adopts the estimator loops’ exact summation form,getTes()’sactual_event_time_tesmay differ from prior versions by a floating-point rounding step (a small multiple of1e-16, i.e. a few ULP) on some data-generating processes.
Version 1.56.8
Documentation
- The high-dimensional (
p >= NT) simultaneous confidence band fromsimultaneousCIs(method = "bootstrap")is no longer flagged experimental. Theoremdebiased.highdim.joint.thm(the desparsified sup-t band) is now validated near-nominally in simulation — family-wise coverage approximately 0.92 over the event-study family (K = 7) at thep >= NTanchor of Faletto (2025), tighter than Bonferroni — the band sibling of the scalardebiasedATT()result. The band documentation, the high-dimensional print banner (its band variant), the bootstrap warnings, and the vignettes are updated to cite the theorem and validated coverage. Thebetwfe()/ non-fetwfe()fallback-band under-coverage warning,se_type = "cluster", the per-fit nodewise-direction feasibility diagnostics, and the sparsity / restricted-eigenvalue assumptions are unchanged. - Documented the high-dimensional band routing: at
p >= NTthe valid simultaneous band issimultaneousCIs(method = "bootstrap"); the analytic default (andeventStudy(ci_type = "simultaneous")) return the post-selection band on the selected support, which under-covers, and agls = FALSEfit has no analytic band. Completes #388.
Version 1.56.7
Minor enhancements
-
getTes()now returnsactual_event_time_tes, the true treatment effect at each event time (periods since adoption), alongside the existing per-cohortactual_cohort_tes. It is the cohort-probability-weighted aggregation of the true per-(g, t)cell effects — the same estimandeventStudy()targets on a fitted panel — giving simulation studies that validate the event-study family a canonical truth to compare against.print()andsummary()on the returned object display the new event-time block.
Version 1.56.6
Documentation
- The high-dimensional (
p >= NT)debiasedATT()overall-ATT interval is no longer flagged experimental. It is now backed by a stated theorem (the desparsified high-dimensional debiased-ATT result,debiased.highdim.thm), and its coverage is validated near-nominally in simulation (approximately 0.94 at thep >= NTanchor of Faletto 2025), robust across the nodewise penalty scales studied. ThedebiasedATT()documentation, the shared high-dimensional print banner (its interval variant), and the high-dimensional vignette are updated accordingly. - The family-wise simultaneous bands at
p >= NT(simultaneousCIs()) remain flagged experimental: the joint-band extension (debiased.highdim.joint.thm) is stated but its coverage is not itself simulation-validated. Thebetwfe()/ non-fetwfe()p >= NTfallback-band under-coverage warning and the per-fit nodewise-direction diagnostics are unchanged.
Version 1.56.5
Documentation
- Split the long inference vignette into three focused vignettes, one topic each:
vignette("inference_vignette")(standard errors and the variance decomposition, including these_typeoptions),vignette("simultaneous_cis_vignette")(family-wise simultaneous confidence bands and the selection-consistency zero-effect test), andvignette("high_dimensional_vignette")(the high-dimensionalp >= NTdebiased path ofdebiasedATT()). The prose and code are unchanged apart from the conservative-SE trim below; internal cross-references now link across the three vignettes. - Trimmed the
se_type = "conservative"treatment in the standard-errors vignette from a standalone section with a worked example down to a short note. The conservative Cauchy-Schwarz SE is an opt-in fallback for propensity-score estimators that violate assumption (Psi-IF); the package ships none such (its default cohort-sample-proportions weights satisfy (Psi-IF)), so under the default estimator there is no practical reason to set it. These_type = "conservative"option itself and its documentation on the estimator help pages are unchanged.
Version 1.56.4
Bug fixes
-
debiasedATT(lambda_c = "cv")can no longer hang on adversarial high-dimensional draws (#384). In thep >= NTregime the cross-validation overlambda_ccould burn unbounded wall-time (observed: ~16 h at 100% CPU on a single fit) because the per-solve iteration cap did not bound the CV grid x folds. The CV now (1) caps the fold solves at their own budget (min(riesz_max_iter, 5000)) — they only rank candidates, while the final deployed solve keeps the fullriesz_max_iter— and bails a grid point whose fold solve fails to converge; (2) builds each fold’s train/test Gram once instead of once per grid point; and (3) accepts an opt-incv_time_budget(seconds; defaultInf) wall-clock backstop that falls back to the theory scale with a warning. Selection is byte-identical for normal fits (the fold cap is a no-op at the defaultriesz_max_iter) and stays deterministic / reproducible unless a finitecv_time_budgetfires. The same fix applies to thesimultaneousCIs()high-dimensional band, which shares this cross-validation.
Version 1.56.3
- Scoped the high-dimensional (
p >= NT) coverage / theory documentation to what is currently established (#364). Forward-references to the not-yet-public high-dimensional theorem (“Theorem 6.6” /debiased.highdim.thm) are softened to a neutral description of the desparsified high-dimensional FETWFE theory pending the paper revision. Thep >= NTprint banner (shared byprint.debiased_attandprint.simultaneous_cis) no longer claims coverage validation unconditionally: it now references the overall-ATT coverage validated with the CV-selected penalty and flags that (for band objects) the family-wise coverage is not itself simulation-validated and (for the scalar interval) coverage at other penalties is not separately validated. The inference vignette’s high-dimensional example now uses the validatedlambda_c = "cv"penalty rather than the default fixed1.0.
Version 1.56.2
- Renamed
debiasedATT()’s bootstrap-CI argument fromse_methodtomethod(and its non-default value from"wild_bootstrap"to"bootstrap") to match the siblingsimultaneousCIs(), whose argument is alsomethodwith values"analytic"/"bootstrap". This resolves the naming inconsistency between the two inference functions before the 2.x release;se_methodnever appeared in a CRAN release (#365).
Version 1.56.1
- Renamed the introductory vignette from
vignette.Rmdtofetwfe.Rmdso it is featured as the “Get started” page on the package website (#283, #371). It is now accessed withvignette("fetwfe")rather thanvignette("vignette"); the content is unchanged.
Version 1.56.0
Bug fixes
-
Corrected the
debiasedATT(se_method = "wild_bootstrap")few-clusters framing (#363). The wild bootstrap added in 1.55.0 was documented as a few-clusters correction that widens the interval, but as an unrestricted, no-refit score / influence-function bootstrap it does the opposite: under heterogeneous cluster influence its self-normalized critical value falls below the Gaussian quantile, narrowing the interval (mildly anti-conservative) in exactly the small-Nregime it was meant to help. The critical value is now floored atqnorm(1 - alpha/2), so the interval is never narrower than the analytic Wald interval, and the documentation is reframed: it is an asymptotically-valid alternative reference distribution that only widens the interval (under near-homogeneous cluster influence), not a few-clusters remedy. A genuine few-clusters correction (a restricted wild-cluster bootstrap-t or a CR2-type analytic adjustment) is tracked as future work (#361). Affects onlyse_method = "wild_bootstrap"(which never appeared in a CRAN release); the default analytic path is unchanged.
Version 1.55.0
New features
-
debiasedATT()gains a wild cluster bootstrap confidence interval for the overall ATT via the newse_method = "wild_bootstrap"argument (withB,seed, andmultiplier). It was introduced as a few-clusters correction for the analytic two-channel sandwich SE (reframed in 1.56.0 — it is not a few-clusters remedy). A studentized score / influence-function bootstrap re-signs the per-unit influence summands (no refit per replicate), so the point estimate and the reportedseare unchanged and only the interval’s critical value changes. The defaultse_method = "analytic"is unchanged; the new path is not supported forindep_counts(two-sample) fits. Implements the deferred small-Nhalf of #307 (#360). - Adds the Webb (2013) six-point multiplier (
multiplier = "webb") to the bootstrap machinery, available to bothdebiasedATT()’s wild bootstrap andsimultaneousCIs(method = "bootstrap"). It is the default fordebiasedATT()’s wild bootstrap, because it varies the studentization denominator ("rademacher"’s is constant). -
simultaneousCIs(method = "bootstrap")anddebiasedATT(se_method = "wild_bootstrap")now share theirB/seedvalidation; a non-integerseed(previously truncated silently byset.seed()) is now rejected with a clear message.
Version 1.54.0
Improvements
- The simulation vignette now documents the targeted-sparsity coefficient mode (
genCoefs(n_signal_cohorts = ...)/treat_base_levels, added in 1.48.0): a new section explaining how it builds a sparse, non-degenerate, heterogeneous high-dimensional (p >= NT) truth that the default uniformdensityplacement cannot, with a worked example (#353 follow-up).
Version 1.53.0
Improvements
- The inference vignette now documents high-dimensional (
p >= NT) debiased inference: a new section with a workeddebiasedATT()/simultaneousCIs()example on ap > NTpanel, the feasibility /lambda_cdiagnostics to inspect, and the high-dimensional coverage result fromgregfaletto/fetwfe#88(debiased ~93% vs fused ~77% at the studied anchor). Closes the last major post-1.10.0 vignette gap (#353).
Version 1.52.0
Improvements
- Updated the high-dimensional (
p >= NT) debiased-inference caveats indebiasedATT()/simultaneousCIs()(their roxygen and the print diagnostics) to reflect the completed coverage study (gregfaletto/fetwfe#88): the overall-ATT coverage is now validated near-nominally at the studiedp >= NTanchor of Faletto (2025), rather than “not yet simulation-validated.” The path is still flagged experimental outside that regime. No code or numeric change (#352).
Version 1.51.0
Bug fixes
- High-dimensional nodewise debiasing: the KKT feasibility check no longer reuses the coordinate-descent convergence tolerance (
riesz_tol,1e-9) as its feasibility slack, which sat below solver precision and so spuriously flagged legitimately-binding nodewise directions as infeasible. The slack is now a fixed1e-6relative tolerance (.riesz_feasible()), fixing over-pessimisticdebiasedATT()/simultaneousCIs()feasibility warnings and the high-dim print diagnostics’ under-reported “KKT-feasible” counts. Surfaced by thep > NTcoverage study (gregfaletto/fetwfe#88) (#351). - As part of the same fix,
lambda_c = "cv"may now select a slightly smaller penalty constant for fits sitting exactly at the feasibility edge (a genuinely-feasible grid point previously excluded by round-off can now win). Defaultlambda_c = 1.0fits – which never invoke the CV feasibility gate – are unchanged (#351).
Version 1.50.0
Improvements
- The
simultaneousCIs()print(),tidy(), andplot()S3 methods now carry full roxygen documentation, so?print.simultaneous_cis(and thetidy/plotequivalents) open help pages, matching thedebiasedATT()method docs (#342). -
simultaneousCIs()gained adefaultmethod that errors with the offending class name when called on an unsupported object, rather than R’s generic “no applicable method” message (#342). -
getTes()andsimulateData()now name the offending class (and usecall. = FALSE) when passed a non-FETWFE_coefsobject, matching the other accessors’ error style (#342). -
debiasedATTWithSimulatedData()now defaultsalpha = NULL, inheriting the fit’s confidence level, consistent with every other accessor (the returned values are unchanged, since the wrapped fit always uses the defaultalpha) (#342). - The
broom::tidy()methods now validateconf.levelwith an actionable message instead of an opaquestopifnot()failure (#342).
Internal
- Documentation and hygiene cleanup from the 2026-06-27 periodic review: renamed the
lambda_node_default()cargument toconst(it no longer shadowsbase::c), removed two no-op self-referential@inheritParamstags, corrected an over-stated comment on thegenCoefs()targeted-sparsity non-degeneracy guards, and fixed two stale references to the defunctgenRandomData()(nowsimulateDataCore()) in thegenCoefsCore()documentation and a code comment. No change to estimates, standard errors, or returned values (#342).
Version 1.49.0
Bug fixes
-
twfeCovs(): fixed an off-by-one in the internal collapse of the treatment-effect columns (.collapse_design_for_twfe_covs()). The pre-collapse extraction began one column too low — it summed a covariate-interaction column into the per-cohort treatment block and dropped the last treatment column — and now uses the validatedgetTreatInds()indices (the same ones theetwfe()path uses). As a result,twfeCovs()output changes versus<= 1.48.0. This is a correction, but anyone reproducing thetwfeCovsbenchmark from the Faletto (2025) simulation studies should note that those numbers will differ. No other estimator (fetwfe(),etwfe(),betwfe()) is affected — none uses this collapse (#339).
Version 1.48.0
Improvements
-
genCoefs()/genCoefsCore()gain a targeted-sparsity mode via two new (mutually exclusive) arguments,n_signal_cohortsandtreat_base_levels. It places a small, controllable, heterogeneous treatment-effect signal on the per-cohort fused base levels (with the covariate / interaction block left at zero), producing a coefficient vector that is simultaneously sparse (||theta||_0equal to the signal count) and non-degenerate (overall ATT!= 0and positive cohort-weight varianceV2 > 0). This is the data-generating process the high-dimensional (p >= NT) desparsified / nodewise debiased-ATT coverage study needs — which the default uniform-densityplacement cannot produce, because atp >> num_treatsit almost never lands signal on the tiny treatment-effect coordinate block (#332). The default uniform-densitybehavior (both new argumentsNULL) is unchanged and byte-identical.n_signal_cohorts = kis the count convenience (a deterministic staircase onkcohorts);treat_base_levelsgives explicit per-cohort fused base levels.simulateData()/getTes()consume the result unchanged.
Version 1.47.0
Improvements
-
eventStudy()now names the offending class when called on an unsupported object (e.g.Got class: lm), matchingcohortStudy()’s error and making misuse easier to debug (#325).
Internal
- Cleanup batch from the 2026-06-19 periodic review (#325): corrected stale paper cross-references in the ATT-variance machinery (the estimated-propensity variance term now points to Theorem 6.4(b) / eq.
v.n.r.t.att.rand, and the cohort-share Jacobian to the proof of Theorem 6.1 — both verified againstpaper_arxiv.tex); de-duplicated thein_sample_countsnamed/unique validation into a single helper; removed two dead commented-out parameters; and documented theriesz_lassofeasibility-certificate and bootstrap degeneracy semantics to prevent future mis-“fixes”. No change to estimates, standard errors, or returned values.
Version 1.46.0
Improvements
-
print()on asimultaneousCIs()result now surfaces the high-dimensional (p >= NT) desparsified-band diagnostics the documentation tells users to inspect: the experimental caveat, the resolved nodewise penalty (lambda_c/lambda_node), and the per-effect KKT feasibility and convergence summary (plus the event-study propensity channel when present). The fixed-pprint is unchanged (#326). -
debiasedATT()now returns a lightweight S3 object of class"debiased_att"withprint()andbroom::tidy()methods (theprint()shares the same high-dim diagnostics). The returned list’s contents and names are unchanged, so existing$-accessor code is unaffected (#326).
Version 1.45.0
Bug fixes
-
simultaneousCIs(method = "bootstrap", lambda_c = "cv")now selects its nodewise penalty constant on the correct overall-ATT direction under scattered (non-consecutive) cohort adoption. The cross-validation directiona_attwas built with hard-coded consecutive-adoption per-cohort sizes(T - 1):(T - G), which under scattered offsets both mis-weight and overrun the treatment-effect index, so the band cross-validated a different penalty constant thandebiasedATT()— silently breaking the documented “onelambda_cfor the point estimate and the band” guarantee (the band center no longer equaleddebiasedATT()$att). It now uses the offset-resolved sizesdiff(c(first_inds, num_treats + 1L)), matchingdebiasedATT(). Consecutive adoption (the common case) and the defaultlambda_c = 1.0are byte-identical; this only affected the experimentallambda_c = "cv"path on scattered data (#323).
Version 1.44.0
Bug fixes
-
simultaneousCIs()now inherits the fit’salphawhenalphais not supplied (the default is nowalpha = NULL), matchingeventStudy()and every other accessor. Previously it hard-codedalpha = 0.05, so a fit built at a non-default level (e.g.fetwfe(..., alpha = 0.10)) displayed 90% simultaneouscatt_dfbands whilesimultaneousCIs(fit)silently returned 95% bands — breaking the documented identity that the displayed bounds are thesimultaneousCIs(fit, family = …)bounds. Passing an explicitalphastill overrides, and default (alpha = 0.05) fits are unaffected (#324). Behavior change on upgrade: if you calledsimultaneousCIs()(or read its bands) on a fit built at a non-defaultalphawithout passing an explicitalpha, the returned bounds now use the fit’s level rather than0.05, so their widths will shift — passalpha = 0.05explicitly to reproduce the pre-1.44.0 output.
Version 1.43.0
Improvements
-
simultaneousCIs(method = "bootstrap")now emits awarning()when called on a non-fetwfe()high-dimensional (p >= NT) fit (e.g.betwfe()). Such a fit has no desparsified (Theorem 6.6) band, so the call falls back to the post-selection fixed-pselected-support band (a band, not an error, preserving #305) – but a coverage study (#308) shows that fallback band substantially under-covers in thep >= NTregime, even when the selected support is low-dimensional: the bridge shrinks the band center toward zero and the post-selection standard error understates sampling variability. The warning flags the result as unreliable and points to using afetwfe()fit for valid high-dimensional simultaneous bands. The@param methoddocumentation and the inference vignette are corrected accordingly (the previous claim that the fallback band is “valid when its selected support is low-dimensional” is empirically falsified) (#308).
Version 1.42.0
Bug fixes
-
simultaneousCIs(method = "bootstrap")no longer returns a degenerate all-zero band in the high-dimensional (p >= NT) regime when the bridge penalty zeroes every treatment effect (#304). There the debiased band center (the Theorem 6.6 desparsified construction) is generally non-zero and informative, so the all-zero early-exit is now bypassed for the high-dim fetwfe bootstrap path, which falls through to the desparsified band (it re-fits its own q=1 nuisance and builds the directions from the full design, both selection-independent). Fixed-p fits (where an all-zero bridge genuinely means a zero estimate),method = "analytic", and non-fetwfe()fits still return the degenerate band. - The “no treatment features selected” early-exit now reports
calc_ses = (q < 1) && gls, matching the normal path (previouslyq < 1alone). So agls = FALSEfit whose bridge zeroes all treatment effects correctly reportscalc_ses = FALSEwithNAstandard errors, andsimultaneousCIs(method = "analytic")/debiasedATT()-style gating treat it consistently (previously it wrongly reportedcalc_ses = TRUEand bypassed thegls = FALSESE gate).
Version 1.41.0
Bug fixes
-
debiasedATT()now supports fits with non-consecutive (scattered-cohort) adoption – adoption times with gaps, e.g.bacondecomp::divorce(#318). Its overall-ATT weight vector was built under a consecutive-cohort assumption (getFirstInds()+sizes <- (T - 1):(T - G)), so a scattered fit mis-assigned the treatment cells to cohorts and tripped the ATT-identity guard. It now resolves the actual adoption offsets via the same offset dispatcher the disaggregated functions (event_study(),cohortTimeATTs(),simultaneousCIs()) already use (v1.13.3, #174), so the identity holds for scattered cohorts in both the fixed-p and high-dimensional regimes. Consecutive-cohort fits are byte-identical (the resolver returns the same offsets, and the block sizes reduce to(T - 1):(T - G)). This was the gap behind the scattered-cohort notes in #316 / #317 and unblocks the divorce high-dimensional application.
Version 1.40.0
New features
-
debiasedATT()now produces its Omega-free cluster-robust standard error forgls = FALSEfixed-p (p < NT) fits (calc_ses = FALSE), the fixed-p analog of the high-dimensional path #307 already supported. Such fits previously errored. The regression channel is the exact-inverse OLS direction with the unit-clustered residual sandwich, and the cohort-weight channel falls back to the propensity-only plug-in (.plugin_v2); both aresig_eps_sq-free, so no GLS whitening is needed (paper Decision D1). This unblocks (1) the boundary bandN(T-1) <= p < NT, where REML cannot fit (gls = TRUEis infeasible) butgls = FALSEcan, and (2) a within-unit-dependence-robust fixed-p SE generally. A GLS-whitenedq >= 1fit still errors (no validated debiased SE); an un-whitened fit is accepted for anyq(the SE is q-independent). The fixed-pgls = FALSESE is valid (not experimental); see also #313 for the simultaneous-band analog.
Version 1.39.0
New features
-
simultaneousCIs(method = "bootstrap")now accepts agls = FALSEhigh-dimensional (p >= NT) fetwfe fit (calc_ses = FALSE), producing cluster-robust simultaneous bands for theevent_study/cohort/all_post_treatment/customfamilies without GLS whitening (#313). This is the band analog of #307’s Omega-freedebiasedATT()SE: the high-dimensional bootstrap variance is the empirical per-unit influence function (cluster-robust by construction) and the band center is the same desparsified Theorem-6.6 estimate, so neither GLS whitening norsig_eps_sqis needed; the band center still matchesdebiasedATT()$atton the overall-ATT contrast. Previously such a fit errored at thecalc_ses = FALSEgate.method = "analytic"still requires valid analytic SEs (aq < 1,gls = TRUE, rank-satisfied fit); the fixed-p(p < NT)gls = FALSEband remains a planned follow-up (#312), and thep >= NTpath stays experimental (coverage validation under #295).
Version 1.38.0
Bug fixes
-
simultaneousCIs(family = "event_study", method = "bootstrap")now desparsifies the propensity (cohort-weight) variance channelF_piin the high-dimensional (p >= NT) regime (#309). Previously the band center was debiased (Theorem 6.6) butF_pi(theSigma_2term) was still built from the post-selection effects, so a cohort the bridge zeroed contributed0to the cohort-weight variance while the debiased center counted its non-zero value – a center/variance inconsistency that under-covered in the heterogeneous-cohort regime (a large zeroedtau_gwith non-trivial cohort-weight uncertainty).F_piis now built from the debiased per-cohort-time effects, computed with the same q=1 fused-lasso nuisance, residuals, and Gram the band center uses (the per-cell nodewiseriesz_lassodirections are themselves new – the center uses one pooled direction per effect), so center andSigma_2are consistent at leading order. Fixed-pfits are unaffected (their selected estimate is unbiased by selection consistency, so the post-selection construction is byte-identical to before). Thep >= NTevent_studypath remains experimental (coverage validation under #295 / paper-sidegregfaletto/fetwfe#88).
Version 1.37.0
New features
-
debiasedATT()andsimultaneousCIs(method = "bootstrap")now acceptlambda_c = "cv"in the high-dimensional (p >= NT) regime. Instead of the fixed theory-scale constant, the leading constant of the nodewise penaltylambda_node = lambda_c * max(|a|) * sqrt(log(p) / N)is selected per fit by 5-fold cross-validation of the unit-level Riesz loss0.5 v'Sigma v - a'v, restricted to the grid penalties that remain KKT-feasible, falling back to the theory scale1.0when none are feasible (the desparsified-lasso / auto-DML standard; van de Geer 2014; Chernozhukov-Newey-Singh 2022). The CV runs on the overall-ATT debiasing direction, so one constant serves both thedebiasedATT()point estimate and everysimultaneousCIs()band effect, and is deterministic (folds seeded from the panel dimensions, ambient RNG preserved). The returned object reportslambda_c,lambda_c_selection("fixed"or"cv"), and (for"cv") thelambda_cvdiagnostics. The default stays the fixed1.0; the"cv"mechanism is opt-in pending simulation validation of its coverage (#295).
Version 1.36.0
New features
-
fetwfe(gls = FALSE)skips GLS whitening and variance-component estimation, so high-dimensional (p >= NT) fits run without suppliedsig_eps_sq/sig_eps_c_sq(previously a hard error from the REML guardp < N(T - 1)inestOmegaSqrtInv()). Such fits havecalc_ses = FALSEand un-whitenedinternal$X_final/internal$y_final; the defaultgls = TRUEis unchanged (#307). -
debiasedATT()now produces its cluster-robust standard error on these un-whitened high-dimensional fits, so thep >= NTpath is usable on real data (not only supplied-variance simulations). The regression channelvar_regis the unit-clustered sandwich (robust to within-unit dependence); the cohort-weight channelvar_weightfalls back to the plug-in(1/N_tau) sum_g pi_g (catt_g - att)^2when the fit carries noatt_var_2(byte-identical toatt_var_2when present). Whitening buys efficiency, not validity (paper Decision D1). Because the high-dimensional branch re-fits its own nuisance,debiasedATT()now accepts anyp >= NTfit regardless ofcalc_ses(a high-dimensionalq >= 1fit is now accepted; previously an error). Thep >= NTpath remains experimental (coverage /lambda_cper #295); small-cluster applications (few treated units) can under-cover — a genuine few-clusters correction (restricted wild-cluster bootstrap-t or CR2) is tracked as #361. (These_method = "wild_bootstrap"option added later in 1.55.0 is not that remedy; see 1.56.0.)
Version 1.35.0
Changes
- The high-dimensional (
p >= NT) debiased nuisance is now an internally-fitq = 1fused lasso (grpreg::cv.grpreg(penalty = "gBridge", gamma = 1), CV-selectedlambda) – the Theorem 6.6 nuisance – rather than the reusedq < 1FETWFE bridgetheta_hat(#303). Theq < 1bridge is super-efficient / non-uniform (the wrong rate for a uniformly-valid CI); only itsl1rate, which the paper establishes for theq = 1fused lasso, controls the orthogonalization remainder. This changes the debiased point estimate (and, through the nuisance residuals, its regression-channel standard error / band width) returned bydebiasedATT()and the high-dimensional band centers ofsimultaneousCIs(method = "bootstrap")(both move to theq = 1nuisance consistently, so they remain equal for the matching contrast). The input fit staysq < 1(the cohort-weight variance channelatt_var_2and thecalc_sesgate are unchanged); fixed-p(p < NT) behavior is unchanged. Thep >= NTpath remains experimental (coverage not yet simulation-validated;lambda_cnot yet tuned, #295).
Version 1.34.0
New features
-
simultaneousCIs(method = "bootstrap")now extends the high-dimensional (p >= NT) desparsified path tofamily = "event_study"and debiases the high-dimensional band centers (#299). A high-dimevent_studyfit now uses the full-designriesz_lassoregression channel together with the per-unit propensity channelF_pi(the two-channelSigma = Sigma_1 + Sigma_2bootstrap), rather than falling back to the fixed-pselected-support construction. In the high-dimensional regime all bands are now centered on the debiased estimate (estimates + colSums(F_reg)/(NT), the Theorem 6.6 correction, equal todebiasedATT()’s point estimate for the matching contrast) instead of the post-selection bridge estimate; this also re-centers the high-dimensionalcohort/all_post_treatment/custombands added in 1.32.0. Thep >= NTpath remains experimental (coverage not yet simulation-validated). Fixed-pbehavior is unchanged. - In the high-dimensional (
p >= NT) regime, asimultaneousCIs()fit whose bridge penalty zeroes every treatment effect now emits awarning()rather than a silentmessage(): an all-zero band there is degenerate and does not imply the effects are zero (selection is not consistent atp >= NT, and the debiased band center is bypassed; see #304). Fixed-pbehavior (amessage()) is unchanged. - In the high-dimensional (
p >= NT) regime,simultaneousCIs(method = "bootstrap")on a non-fetwfe()fit (e.g.betwfe()) uses the fixed-pselected-support band instead of erroring: the full-design desparsified path isfetwfe()-only, so a non-fetwfep >= NTfit falls back to the fixed-pconstruction (valid when its selected support is low-dimensional). This restores the fixed-pfallback for theevent_studyfamily and extends it to the regression-channel families (cohort/all_post_treatment/custom).
Version 1.33.0
New features
-
simultaneousCIs(method = "bootstrap")now supportsfamily = "event_study", completing the multiplier bootstrap’s family coverage (#142). The event-study family is the one whose simultaneous-band variance carries a non-zero cohort-probability (propensity) termSigma_2, so the bootstrap perturbs a per-unit propensity influence function (the cohort-sample-proportion summandxi_i = e_{W_i} - pi_hat,pi_hat_g = N_g / N) with its own independent multiplier stream alongside the regression channel – a two-channel bootstrap matching the analyticSigma = Sigma_1 + Sigma_2(paper Theorem C.1 Step 5 shows the two channels are asymptotically uncorrelated, so their variances add with no cross-term). On ase_type = "cluster"fit the event-study bootstrap per-effect standard errors equal the analytic ones to machine precision. The fixed-pselected-support construction is used (including for high-dimensionalp >= NTfits whose selected support is low-dimensional); the high-dimensional desparsified event-study combination remains a planned follow-up.
Version 1.32.0
New features
- The
simultaneousCIs()multiplier bootstrap (method = "bootstrap", added in 1.31.0) now extends to the high-dimensional (p >= NT) regime, where the analytic Gram inverse need not exist so there is no analytic sup-t band. There the bootstrap builds each effect’s debiasing direction by the full-design desparsified (nodewise /riesz_lasso) construction ofdebiasedATT()(#31, paper Theorem 6.6), generalized to the effect family – uniformly valid, not post-selection. It returns per-effectfeasibility/converged/lambda_nodediagnostics and aregimefield. The path is experimental (fetwfe()fits only; its finite-sample coverage is not yet simulation- validated). The penalty constantlambda_cdefaults to the theory scale1.0, which keeps the nodewise directions feasible; smaller values can leave them infeasible, in which case a warning fires and the affected bands are unreliable. New argumentslambda_c/riesz_max_iter/riesz_tolcontrol the solver (ignored whenp < NT). The simulator can now generate thep > NTpanels needed to exercise this path (see 1.30.0 / #293).event_studyand the fixed-ppath are unchanged (#142).
Version 1.31.0
New features
-
simultaneousCIs()gains a multiplier-bootstrap method (method = "bootstrap"), the Chernozhukov-Chetverikov-Kato (2013) sup-t bootstrap, as an alternative to the default analyticmvtnorm::qmvnorm()critical value (method = "analytic", unchanged and still the default). It perturbs the per-unit influence functions with random multipliers (multiplier = "rademacher"or"mammen",Breplicates, optionalseed) and reads the simultaneous critical value off the bootstrap distribution. The two methods are asymptotically equivalent; the bootstrap scales better to large effect families (whereqmvnormstrains) and is heteroskedasticity/cluster-robust by construction. The per-unit influence matrixFreproduces the cluster-robust joint covariance (crossprod(F) / (NT)^2equals it up to theN/(N-1)finite-sample factor), so on ase_type = "cluster"fit the bootstrap per-effect standard errors match the analytic ones exactly. This release coversfamily = "cohort","all_post_treatment", and"custom";"event_study"(whose cohort-probability variance term needs a per-unit propensity influence function) and the high-dimensionalp >= NTregime are planned follow-ups (#142).
Version 1.30.0
Improvements
-
simulateData()/simulateDataCore()can now generate high-dimensional (p > NT) panels. PreviouslygenCohortTimeFE()enforcedN >= (G + 1) * (d + 1)unconditionally (every cohort needed at leastd + 1units), which structurally confined the generator to thep < NTregime. That stricter bound is now gated behindguarantee_rank_condition(consistent with every other rank guard in the generator); with the defaultguarantee_rank_condition = FALSEonly>= 1unit per cohort is required, so small cohorts – and thereforep > NTdesigns – are reachable. This lets the high-dimensionaldebiasedATT()path (added in 1.29.0) be exercised on syntheticp > NTdata with a known data-generating coefficient vector (for coverage studies of the method; recovering the truth requires an adequate number of units). Generation withN >= (G + 1) * (d + 1)is unchanged, andguarantee_rank_condition = TRUEstill enforces the full-rank bound (#293).
Version 1.29.0
New features
-
debiasedATT()now also supports high-dimensional (p >= NT) fits, where the unrestricted ETWFE is infeasible and the fixed-pexact-inverse debiasing direction is invalid. In that regime the debiasing direction is instead the nodewise (desparsified-lasso) relaxed inverse of the design Gram (paper Theorem 6.6,debiased.highdim.thm). It is the same estimator and standard error as the fixed-pcase — only the construction of the debiasing directionvchanges — so existingp < NTresults are unchanged (byte-identical). Thep >= NTerror introduced in 1.28.0 is lifted. New argumentslambda_c,riesz_max_iter, andriesz_tolcontrol the nodewise solver (ignored whenp < NT), and forp >= NTfits the returned list gainsfeasibility,converged, andlambda_nodediagnostics. The high-dimensional path is experimental: its finite-sample coverage is not yet validated by simulation and the penalty constantlambda_cis not yet tuned — inspect the returned diagnostics and treatlambda_cas a tunable knob (#31).
Version 1.28.0
New features
- New accessor
debiasedATT()(with adebiasedATTWithSimulatedData()wrapper) returns a debiased overall-ATT point estimate and a uniformly-valid standard error from a fittedfetwfe()object (q < 1). It is a complement to the fused plug-in interval (fit$att_hat/fit$att_se), which under-covers the aggregated overall ATT; the debiased interval restores asymptotically nominal coverage at roughly the efficiency of unrestricted ETWFE. The debiased point estimate differs from the fusedatt_hat(by the OLS identity it equals the ETWFE/OLS estimate in the ATT direction), so it is exposed as its own accessor rather than ase_typeoption. The standard error has a per-unit-clustered regression channel plus a cohort-weight channel that add under marginal cohort assignment / (Psi-IF); the assumptions are documented on?debiasedATT. Errors cleanly forq >= 1(no selection). (At this version it also errored for the high-dimensionalp >= NTregime; that regime is supported as of 1.29.0.) (#291).
Version 1.27.3
Bug fixes
-
eventStudy(),cohortTimeATTs(), andsimultaneousCIs()no longer error on a fit produced withindep_countswhen the treated cohorts adopt later than the earliest panel periods (e.g. cohorts adopting in 2005–2009 within a 2000–2010 panel). The accessors previously failed withfirst_inds[G] <= n_vars is not TRUE(eventStudy()/cohortTimeATTs()) orsubscript out of bounds(simultaneousCIs()). The cause: theindep_countspath storedcohort_probsunnamed, so the cohort adoption timing could not be recovered and the accessors fell back to the earliest-timing layout, inconsistent with the actual number of treatment effects.att_hat/att_se/catt_dfare unchanged by this fix (it only attaches the previously-missing cohort labels) (#288). Older savedindep_countsfits also now recover their cohort timing (fromcatt_df) without re-fitting. Note: withindep_countstheeventStudy()event-time estimates and the overallatt_hatare (as before) re-weighted by the independent-sample cohort probabilities; the per-cellcohortTimeATTs()estimates are unchanged byindep_counts.
Version 1.27.2
Improvements
-
genCoefs()andgenCoefsCore()now acceptdensity = 1, which yields a fully dense (non-sparse) coefficient vector — every entry of the initialthetais nonzero. Previouslydensityhad to be strictly in(0, 1); the accepted range is now(0, 1]. This supports simulating data in which the FETWFE sparsity assumption is maximally violated.density <= 0(which would zero every coefficient) anddensity > 1still error (#286).
Version 1.27.1
Documentation
- Surfaced the fusion-penalty structure options on high-traffic documentation surfaces (#282). The choice of fusion geometry —
fusion_structure = "cohort"(default) vs."event_study", and the customfusion_matrixoverride — is a core differentiator of FETWFE but was previously reachable only through a buried@param. It is now named in a new “Penalty and fusion structures” section of the README, cross-linked from the introductory and simulation vignettes to the existing “Choosing a fusion structure” vignette, pulled intofetwfe()’s@description, and given a@seealsoonfetwfe()andgenCoefs()(the two functions that exposefusion_structure).
Version 1.27.0
New features
- New accessor
cohortTimeATTs()returns the fully disaggregated treatment effects — one row per(cohort, time)cell, with no averaging over either axis — complementingcohortStudy()(per-cohort, time-averaged) andeventStudy()(per-event-time, cohort-averaged). Standard errors are the per-cell regression standard errors, recomputed from the fit exactly aseventStudy()does (matchingsimultaneousCIs(family = "all_post_treatment")to floating-point precision); confidence intervals and p-values are pointwise. A cell zeroed out by the fusion/bridge penalty reportsestimate = 0,se = 0, andselected = FALSE. Supportsfetwfe(),etwfe(), andbetwfe()(likeeventStudy());broom::tidy()is supported viatidy.cohortTimeATTs()(term = "cohort_<g>_time_<t>") (#280).
Version 1.26.5
Bug fixes
-
print.twfeCovs()now accepts amax_event_timesargument, for parity with the other estimators’ print methods, instead of erroring with “argument matched by multiple actual arguments” when one was supplied. The argument is a no-op fortwfeCovs(its output has no event-study section) (#267). -
attgtToFetwfeDf()/etwfeToFetwfeDf()now validate theout_namesargument (it must be a list containing the four keystime,unit,treatment, andresponse) and raise a clear error naming that contract, instead of failing later with a cryptic internal message — including the case of a named character vector, which carries the right names but is indexed with$downstream (#268).
Version 1.26.4
Improvements
- The reported model-size diagnostics
lambda.max_model_size,lambda.min_model_size, andlambda_star_model_size(fromfetwfe()/betwfe()and their*WithSimulatedDatawrappers) now count the number of selected features and exclude the always-present intercept, matching the documentation (“ideally close to 0 /p”) andglmnet’sdfconvention. Previously each also counted the intercept, so the smallest model reported 1 instead of 0. This shifts each of the three reported sizes down by 1. It does not changelambda_star, the coefficients, the treatment-effect estimates, or their standard errors: the intercept is a constant offset on the BIC, so model selection is identical. Resolves the doc/behavior inconsistency in #269.
Version 1.26.3
Bug fixes
- The estimators (
fetwfe()/etwfe()/betwfe()/twfeCovs()) now emit a warning when exactly one ofsig_eps_sq/sig_eps_c_sqis supplied and the other is leftNA. The two noise variances are estimated jointly by REML, so supplying only one silently discarded it (re-estimating both); the warning names the ignored value and notes that they must be supplied together or both omitted (#266).
Version 1.26.2
Bug fixes
-
print()andsummary()for theFETWFE_tesobject returned bygetTes()now label cohorts by calendar adoption time (cohortgadopts at timeg + 1), matchingtidy.FETWFE_tes()and the fitted estimators’catt_df$cohort. Previously they used the 1-based loop index, so the same cohort showed as e.g. “Cohort 1” underprint()/summary()but “Cohort 2” undertidy(). The convention now lives in one shared helper (#261).
Version 1.26.1
Documentation
-
fetwfe()andbetwfe()runnable@examplesnow guard theirlibrary(bacondecomp)/data(castle)usage behindif (requireNamespace("bacondecomp", quietly = TRUE)) { ... }.bacondecompis a Suggests-only dependency, so previouslyexample(fetwfe)/example(betwfe)errored for users without it installed (#260). - Clarified
twfeCovs()’s title/description: it estimates a single pooled treatment effect per cohort (not per-(cohort, time)), matching the body text; added the “Optional” qualifier togenCoefs()’s@param G(#257).
Version 1.26.0
New features
-
twfeCovs()now returns a fully-featured S3 object: a styledprint()/summary()plustidy()/glance()(broom), matching the three sibling estimators (fetwfe(),etwfe(),betwfe()).plot()andaugment()are intentionally not defined —twfeCovs()estimates one pooled effect per cohort (so there is no per-(cohort, time) / event-study structure to plot) and its coefficient vector lives in a reduced cohort-level basis (soaugment()’s fitted-value path does not match); both raise an informative error (#58).
Version 1.25.0
Bug fixes
-
getTes()no longer perturbs the caller’s random-number generator. Under a covariate-dependent ("multinomial"/"ordered") assignment DGP it integrates the expected cohort propensities by Monte Carlo, and that draw previously advanced the caller’s.Random.seedas a side effect.getTes()is an analysis/truth function, so the integration now runs under a restored RNG (the per-cohort truth is unchanged): the caller’s.Random.seedis saved and restored, leaving the user’s stream untouched (#254).
New features
-
genCoefs(),genCoefsCore(), andsimulateDataCore()now acceptseed = NAto draw from the ambient random-number generator silently (noset.seed()call), matching the behavior already available onsimulateData(). As before, an explicit numericseedcallsset.seed()(reproducible draw, global RNG left advanced) andseed = NULLdraws from the ambient stream; an invalidseednow reports a single canonical message ("seed must be NULL, NA, or a single numeric value") (#254).
Version 1.24.0
Breaking changes
-
simulateData()now draws from the ambient random-number generator by default and no longer reusescoefs_obj$seed(the seedgenCoefs()used to build the coefficients). PreviouslysimulateData()silently calledset.seed(coefs_obj$seed)internally, so repeated calls on one coefficients object returned byte-identical panels and a precedingset.seed()was ignored. The newseedargument controls the panel RNG: the default (seed = NULL) draws from the ambient generator (respecting any precedingset.seed()) and emits a warning that this default changed; passseed = <integer>to restore reproducibility (the same integer always yields the same panel), orseed = NAto use the ambient generator silently. To vary the panel across Monte Carlo replications, pass a differentseedeach replication instead of mutatingcoefs_obj$seed(#250).
Version 1.23.0
Features
-
fetwfe(),etwfe(),betwfe(), andtwfeCovs()(and the*WithSimulatedData()wrappers), along withgenCoefs()andsimulateData(), now support a single treatment effect (one post-treatment period for the treated cohort), down to the true 2x2 case (T = 2,G = 1) and a late-adopting single cohort (G = 1,T >= 3, adopting in the final period). This removes thenum_treats >= 2requirement added in #112, giving continuity for simulation sweeps overT(#251). AtT = 2– the unique configuration with nothing to fuse –fetwfe()now warns that no fusion penalty applies and the bridge penalty reduces to individual shrinkage; the other estimators and the late-adopting case (which still fuses the time fixed effects) do not warn.
Version 1.22.0
Features
-
fetwfe(),etwfe(),betwfe(), andtwfeCovs()(and the*WithSimulatedData()wrappers), along withgenCoefs()andsimulateData(), now support a single treated cohort (G = 1): one cohort of units that adopt treatment plus never-treated units, rather than requiring at least two treated cohorts (#112). At least two treatment effects (two post-treatment periods for the treated cohort) are still required so the dynamic-effect fusion has something to fuse; a panel with a single post-treatment period (e.g.T = 2, or a cohort adopting in the final period) is rejected with a clear message.
Version 1.21.1
Minor improvements
- The estimator input validation now rejects
sig_eps_sq = 0with a clear “must be positive” error. Previously only negative values were rejected, and a zero noise variance produced an opaque downstream failure (the GLS transform1 / sqrt(sig_eps_sq)is non-finite). Part of a small internal cleanup batch (#185) that also hardens several internal invariants and the integer return types of internal index helpers.
Version 1.21.0
Features
-
fetwfe()(andfetwfeWithSimulatedData()) gain afusion_matrixargument: an optional user-suppliednum_treats x num_treatsforward-differences matrixD_Nfor the treatment-effect block. When supplied it overridesfusion_structurefor that block (the estimator usessolve(fusion_matrix)internally), letting advanced users encode arbitrary identifying-restriction structures beyond the two built-ins. The rows/columns follow the cohort-major(g, t)order ofgetFirstInds()/getTreatInds(). Under the paper’s fixed-dimension scoping any finite, invertibleD_Ninherits the inferential guarantees (Assumption (D) of Faletto 2025), sofetwfe()validates only thatfusion_matrixis finite and invertible (else it stops); a numerically near-singularD_Nstill fits but triggers awarning().fusion_matrix = NULL(the default) is byte-identical to prior behavior (#236).
Version 1.20.0
Features
-
genCoefs()andgenCoefsCore()gain afusion_structureargument ("cohort"or"event_study"), the simulation-side companion to thefetwfe()argument added in 1.19.0. Under"event_study"the generated true coefficients are sparse in the event-study basis (treatment effects that share the same time since treatment are fused across cohorts), letting simulation studies generate truth matched to the event-study penalty."cohort"(the default) is byte-identical to prior behavior. The returnedFETWFE_coefsobject carries (and prints) afusion_structureslot, and the “Choosing a fusion structure” vignette now generates its event-study example natively via this argument (#237).
Version 1.19.1
Documentation
- Added a vignette (“Choosing a fusion structure: cohort vs. event-study penalties”) demonstrating the two
fetwfe()fusion_structureoptions side-by-side on a simulated panel, with guidance on when to prefer each and a note distinguishing the estimation-timefusion_structure = "event_study"penalty from the reporting-timefamily = "event_study"aggregation (#40).
Version 1.19.0
Features
-
fetwfe()gains afusion_structureargument ("cohort"or"event_study"). Under"event_study"the treatment-effect fusion penalty fuses effects at the same time since treatment (event timee = t - g) across cohorts, instead of the default within-cohort / between-cohort two-way fusion — the event-study identifying restriction common in applied DiD. This shrinks toward an event-study structure when the data support it, recovering event-time-structured effects with smaller error than the default. The event-study penalty satisfies the same theoretical guarantees as the default (Faletto 2025, event-study singular-value lemma): same singular-value constants, so every consistency / selection / asymptotic-normality result transfers verbatim."cohort"(the default) is byte-identical to prior behavior (#40). - Note:
fetwfe()objects now carry afusion_structureslot. Saved fits from prior versions lack it and will fail validation when passed toeventStudy(),simultaneousCIs(), orcohortStudy(); re-fit under 1.19.0 to restore compatibility.
Version 1.18.1
User-facing
-
print()andsummary()on agetTes()(FETWFE_tes) object now display a “Cohort assignment DGP” section – the assignment type, strength, and propensity-derived cohort weights – for objects generated under a covariate-dependent DGP (assignment_type = "multinomial"or"ordered"). Marginal-DGP objects print exactly as before. To support this,getTes()output additionally carries theassignment_typeandassignment_strengthslots, copied from the sourceFETWFE_coefs(#189). -
fetwfe()andbetwfe()now warn whenlambda.max,lambda.min, ornlambdaare supplied under the defaultlambda_selection = "cv", which builds its own cross-validation grid and ignores them. Setlambda_selection = "bic"to use a custom lambda grid (#185).
Version 1.18.0
Inference
-
catt_df(cohort ATTs) andeventStudy()now report a multiplicity-adjustedp_valuethat follows the fit’sci_type, completing the simultaneous- inference default introduced in #197 (#200). Underci_type = "simultaneous"(the default) thep_valueis the single-step max-T (family-wise) adjusted p-value – the exact dual of the simultaneous band, so a coefficient lies outside its1 - alphaband iff its adjustedp_value < alpha. Underci_type = "pointwise"thep_valuestays the per-effect Wald p-value (unchanged). The adjustment reuses the joint covariance assembled for the band (mvtnorm::pmvnorm(); Bonferroni underse_type = "conservative"), andsimultaneousCIs()now returns the per-effectadjusted_p_values. The overall-ATTatt_p_valueis a single scalar (K = 1) and is unchanged.
Version 1.17.5
Performance
- Vectorized
getBetaBIC()’s BIC-path coefficient selection (#168, #169): the per-lambdaloop’s separate matrix-vector products are now a single BLAS-3 matrix multiply, and the redundant per-lambdaO(N*T)scan for non-finite fitted values insse_bridge()was dropped, giving roughly a 1.4x speedup of the selection step whenlambda_selection = "bic". The selected coefficients and all downstream estimates are byte-identical to the previous implementation.
Version 1.17.4
Documentation and messages
- Doc/message sweep (#208): corrected stale documentation introduced by the #192/#197 simultaneous-CI changes –
cohortStudy()’sci_low/ci_highare now described by the fit’sci_type(simultaneous by default) rather than as a “Wald CI”;simultaneousCIs()’sse_typereferences and thecustom-family variance caveat were clarified (theSigma_2 = 0simplification is anti-conservative for a contrast that pools across cohorts in a probability-weighted way); and notes were added ongenCoefs()’sG = NULLdefault andsimulateData()’s deterministic re-seeding. In addition,check_etwfe_core_inputs()now emits the same friendly single-cohort error message asprep_for_etwfe_core()instead of a barestopifnotfailure.
Version 1.17.3
Bug fixes
- Fixed: removed a duplicated
ci_typeentry from thefetwfe()andfetwfeWithSimulatedData()@returndocumentation, so the slot is listed once (not twice) in?fetwfe/?fetwfeWithSimulatedData. Thedoc-slot-paritytest now also guards against duplicate top-level@returnitems. (#206)
Version 1.17.2
Bug fixes
- Fixed:
getGramInv()now degrades gracefully (a warning pluscalc_ses = FALSE) instead of aborting with an uncaught LAPACK “system is computationally singular” error when the selected-feature Gram is near-singular (reciprocal condition number belowsolve()’s tolerance). The singularity guard is now condition-number-aware andsolve()is wrapped in atryCatch()routing to the same fallback. (#205)
Version 1.17.1
Bug fixes
- Fixed:
twfeCovs()now honors itsalphaargument when building the default simultaneous confidence band (previously the band was always computed atalpha = 0.05regardless of the requested level). The class gains analphaslot. (#204)
Version 1.17.0 (2026-06-01)
Deprecations
- The user-facing cohort-count is now named
G(the canonical name), matching thedid/ Callaway-Sant’Anna staggered-adoption convention. This applies to thegenCoefs()/genCoefsCore()/simulateDataCore()cohort-count argument, the returned-list field on every estimator (fetwfe(),etwfe(),betwfe(),twfeCovs()) and on the simulation objects (FETWFE_coefs,FETWFE_simulated,FETWFE_tes), and theprint()/summary()display (Treated cohorts (G)). The old nameRis deprecated: passingR =to those functions still works but emits a one-time warning and is mapped toG, and the$Rfield is still populated (with the same value as$G). The deprecatedRargument and$Rfield will be removed in a future release; passG(and read$G) to silence the warning and adopt the new name (#41).
Bug fixes
- Replaced three non-ASCII characters (
Ψ,′,→) in the roxygen documentation ofeventStudy()andtidy.eventStudy()with LaTeX-safe\eqn{}equivalents, so the PDF reference manual builds. These characters were introduced with the simultaneous-CI / tight-Gaussianity documentation in 1.15.0–1.16.0 and would have failedR CMD check’s PDF-manual build at the next CRAN submission (devtools::check()runs with--no-manual, so the per-PR checks did not surface them).
Version 1.16.0 (2026-06-01)
Changed defaults
- Behavior change: the default confidence-interval bounds reported for cohort-specific ATTs (
catt_df$ci_low/catt_df$ci_high, also surfaced bycohortStudy()andbroom::tidy()) and for event-study effects (eventStudy(), shown inprint/summary/plotand surfaced bybroom::tidy()) are now simultaneous (family-wise, uniform) bands rather than per-effect pointwise Wald intervals (#197). Each family’s band now covers all of its effects jointly with probability1 - alpha, matching the default presentation ofdid::aggte(cband = TRUE)(which uses a multiplier bootstrap;fetwfeuses the parametricsimultaneousCIs()machinery added in 1.15.0). A new fit-time argumentci_type = c("simultaneous", "pointwise")(default"simultaneous") controls this; passci_type = "pointwise"tofetwfe()/etwfe()/betwfe()/twfeCovs()to restore the exact pre-1.16.0 bounds everywhere (thebroom::tidy()outputs included). Only the interval bounds change: standard errors, per-cohort p-values, selection flags, and the overall-ATT confidence interval are identical under both settings.
Version 1.15.1 (2026-06-01)
Documentation
- Expanded the inference vignette (
vignette("inference_vignette")) with a new section explaining FETWFE’s restriction selection consistency (Faletto 2025, Theorem 6.2) as an implicit test of the zero-effect null: a cohort the bridge penalty selects out (catt_df$selected == FALSE,p_value == NA) is the asymptotic conclusion that the cohort’s true effect is zero — a stronger statement than a confidence interval on an unregularized estimator can provide, where an exactly-zero estimate is a measure-zero event. The section attributes the conclusion to theselectedflag (not a Wald statistic, which the paper notes cannot test the zero null), states theq < 1caveat, and includes a controlled-truth simulated worked example in which FETWFE selects out exactly the truly-zero cohort. Also corrected a stale theorem cross-reference in the cluster-robust section (the bridge oracle property is Theorem 6.3, not 6.2) (#30).
Version 1.15.0 (2026-05-31)
New features
- Added
simultaneousCIs()(#192): a new exported S3 generic that returns parametric simultaneous(1 - alpha)confidence intervals over user- specified families of treatment effects from a fittedfetwfe()/etwfe()/betwfe()/twfeCovs()object. The simultaneous critical value is the(1 - alpha)quantile ofmax_k |Z_k|under the joint multivariate-normal distribution of the effect family, computed viamvtnorm::qmvnorm(..., algorithm = mvtnorm::GenzBretz())(mvtnorm’s default quasi-Monte Carlo integration; deterministic in its inputs via an internal fixed seed that does not perturb the caller’s random stream), under Faletto (2025) Theorem (c’) tight Gaussianity and Assumption (Psi-IF). Supports four families:"event_study"(one effect per post- treatment event time),"cohort"(one effect per treated cohort),"all_post_treatment"(one effect per(r, t)cell), and"custom"(a user-suppliedK x num_treatscontrast matrix matching themultcomp::glht()convention). Returns asimultaneous_cisS3 object with a$cidata frame (estimate / simultaneous / pointwise CIs side by side),$critical_value,$pointwise_critical_value(qnorm(1 - alpha/2), for reference), and$bonferroni_critical_value(qnorm(1 - alpha/(2K)), for reference; strictly larger than the simultaneous critical value when effects are positively correlated, as is typical in DiD). Includesprint/tidy/plotmethods following the existing S3 patterns;plot()requiresggplot2(already in Suggests).mvtnormis added toSuggests(used only when this function is called; the defensiverequireNamespace()guard fires with an actionablestop()if missing, and only whenK > 1andse_type != "conservative"). A new vignette section ininference_vignette.Rmdshows a worked event-study example contrasting simultaneous vs per-point CIs.
Refactor
- Consolidated three existing inline Jacobian-build sites (
getSecondVarTermOLS,getSecondVarTermDataApp,.event_study_var2_fetwfe) into a single.build_jacobian()helper inR/variance_machinery.R(#192; WORKFLOW_LESSONS §14 Class A: the third copy triggers a refactor, ahead ofsimultaneousCIs()becoming a fourth call site). Byte-identity of the overall-ATT, per-cohort CATT, and per- event-time event-study standard errors was verified pre- and post- refactor.
Version 1.14.1 (2026-05-31)
New features
- Added optional
assignment_interactionsandassignment_interaction_strengtharguments togenCoefs()(#191). When non-NULL, the covariate-dependent propensity DGPs introduced in 1.14.0 gain pairwise multiplicative interaction terms (including self-interactions / quadratic terms viac(j, j)) in the linear predictor — only inside the propensity model; the outcome model continues to use the originalX. Pairs are canonicalized toc(min, max)and silently deduplicated. Theassignment_coefsslot onFETWFE_coefsgains$interactionsand$deltasub-slots; a new top-level$assignment_interaction_strengthslot mirrors$assignment_strength.genCoefs()also gains averbose = FALSEargument; settingverbose = TRUEemits amessage()when canonicalization removes duplicate or unordered pairs (default is silent — users can verify the final canonical list viacoefs$assignment_coefs$interactions). Unlocks adversarial- propensity Monte Carlo DGPs for the FETWFE vs Callaway-Sant’Anna comparison work tracked at #140. Defaultassignment_interactions = NULLpreserves v1.14.0 behavior byte-identically on every existing test.
Version 1.14.0 (2026-05-30)
New features
- Added covariate-dependent cohort-assignment DGPs to
genCoefs()andsimulateData()(#162). New argumentsassignment_type("marginal"/"multinomial"/"ordered") andassignment_strengthcontrol whether cohort membership in the simulated panel is drawn marginally (the current default behavior, preserved byte-identically) or from a multinomial-logit or ordered-logit (proportional-odds) propensity-score model over the covariates. TheFETWFE_coefsobject gains$assignment_type,$assignment_strength, and$assignment_coefsslots; theFETWFE_tesobject gains a$cohort_weightsslot.getTes()updated to compute the propensity-weighted population ATT truth under the new DGPs via Monte Carlo integration over the covariate distribution, matching Eq.att.estimator.weighted(Faletto 2025, line 837). Newsimulation_vignette.Rmdsection demonstrates the three DGP modes side-by-side with worked examples. Unlocks realistic Monte Carlo studies where FETWFE has to handle conditional-on-covariate cohort selection (relevant to the FETWFE vs Callaway-Sant’Anna comparison work tracked at #140).
Version 1.13.8 (2026-05-30)
Internal
Deleted an unreachable
if (length(cohorts) == 0) stop(...)block inidCohorts()(#180 DC1). The block sits AFTER an unconditionalcohorts[[as.character(times[1])]] <- character()insertion, solength(cohorts) >= 1always by the time it runs. The actual “all units treated in first period” catch lives earlier in the function atif (length(units) == 0) stop(...). Zero behavior change; 5 lines deleted.Dropped a vestigial
sel_indslist and the now-unusedfirst_indsparameter fromgetSecondVarTermOLS()inR/variance_machinery.R(#180 DC2). The list was built solely to feed a tautologicalstopifnot(all.equal(...))assertion; the Jacobian construction below it never read the list. Both call sites (getTeResultsOLS()and theeventStudy()dispatcher) updated to stop passingfirst_inds. The sibling functiongetSecondVarTermDataApp()keeps its ownsel_inds— there it is genuinely used to sliced_inv_treat_sel. Zero behavior change.Closed the cross-estimator parity gap from PR #144 (#180). FETWFE fits now expose
fit$calc_sesat top level, matchingetwfe()/betwfe()/twfeCovs(). Value is identical tofit$internal$calc_ses(already present)..EXPECTED_SLOTS_FETWFEand the@returndoc updated. Pure addition; no existing slot removed.
Documentation
Reworded the misleading “canonical path is
$internalgoing forward” comment inR/etwfe_class.R,R/betwfe_class.R,R/twfeCovs_class.Rto match what the code actually does (#180). PR #154’s$internalmigration was paused without ever being completed — the print extractors in each class file still read top-level — so “going forward” was forward-looking but inaccurate. The new comment correctly identifies which sub-slots are duplicated at top level (the first five:X_ints,y,X_final,y_final,calc_ses) and which live only under$internal(variance_components,first_year).Reworded 3 inline-source “The five slots” comments at
R/fetwfe.R,R/betwfe_core.R,R/twfeCovs.Rto match the post-#179 roxygen wording (#180 carry-over from #179). Both reviewers of #179 flagged these as scope-appropriate for #180 because they contained both the now-stale “five slots” wording and the now-retired “canonical going forward” claim.
Version 1.13.7 (2026-05-30)
Documentation
- Fixed three roxygen documentation issues in the four estimator entry points and their
*WithSimulatedData()wrappers (#179):- eight
@return \item{se_type}{}parenthetical notes acrossR/fetwfe.R/R/betwfe_core.R/R/twfeCovs.Rlisted only"default"and"cluster", dropping"conservative"(added in v1.12.0 / PR #163); they now correctly list all three values; - six
@return $internaldescribe-blocks said “The five sub-slots are also duplicated at top level” but the describe-list contained seven sub-slots; the framing now correctly notes thatvariance_componentsandfirst_yearlive only under$internal; (c) the internal helpercheckFetwfeInputs()was missing@paramlines forlambda_selection,cv_folds, andcv_seed. Zero behavior change; affects rendered help pages only.
- eight
Version 1.13.6 (2026-05-29)
Bug fixes
- Guarded against integer overflow in
getBetaBIC()’s BIC formula (R/fetwfe_core.R) at panels withN * T > .Machine$integer.max ≈ 2.15e9(#178). CoercesN * Tto numeric before multiplying, mirroring the existinggetBetaCV()safeguard. No user-visible change at realistic panel sizes; the BIC opt-in path on >2.15e9-cell panels now computes correctly instead of failing with an unhelpfulstopifnottrace.
Internal
Rewrote
test-gls-kronecker-block-apply-165.R(#178) to call.estimate_variance_and_gls()directly rather than re-deriving both sides of the block-apply identity inline. The previous test asserted an algebraic identity that holds by construction; the new test pins the production function’sy_gls/X_glsagainst an explicit-Kronecker reference, so a future refactor that silently breaks the GLS reshape step is caught here rather than via downstream end-to-end tests.Sharpened the
tidy.eventStudy(es, conf.level = ...)regression test intest-broom-methods.R(#178). The previous parametric assertion(td_99 width) >= (td_95 width)held even ifconf.levelwere completely ignored; the new sharpexpect_equal((qnorm(0.995) - qnorm(0.975)) * std.error)form pins the exact CI half-width formula.
Version 1.13.5 (2026-05-29)
Bug fixes
- Fixed a silent RNG-state regression introduced in v1.13.0 (#177): every default-path
fetwfe()/betwfe()call was overwriting the caller’s.GlobalEnv$.Random.seedbecausegetBetaCV()inR/fetwfe_core.Rcalledset.seed(cv_seed)without saving and restoring the previous state. Wrapped theset.seedcall in anon.exit({ assign(".Random.seed", old, envir = .GlobalEnv) })guard so the caller’s RNG state is preserved across the fit. The v1.12.x default BIC path was unaffected (it never set a seed); this fix restores RNG semantics to that prior behavior on the CV-default path. Estimator output is unchanged.
Version 1.13.4 (2026-05-29)
Bug fixes
- Fixed
eventStudy()on panels with non-consecutive cohort years. PR #156 (closing #138) wrapped theeventStudy(x)call insideprint.<class>()andsummary.<class>()intryCatch(..., error = function(e) NULL); on panels where treated cohorts adopt at scattered time indices (the canonicalbacondecomp::divorcepanel: states adopt no-fault divorce in 1969-1985 with gaps at 1978, 1979, 1981, 1982, 1983) the underlyingeventStudy()raisedfirst_inds[R] <= n_vars is not TRUEinsidegenInvTwoWayFusionTransformMat()becausegetFirstInds(R, T)andgetNumTreats(R, T)both assumed cohorts adopt at consecutive offsets2, 3, ..., R + 1. The tryCatch then silently omitted the section, so users on real-world panels saw nothing where the Event Study block should have rendered. Two layers of fix:-
Layer A (no silent swallow). The
tryCatchswallow inR/class_helpers.R::.print_estimator_output()and.summary_estimator_output()is removed.eventStudy()’s contract is “succeeds on any fit produced byfetwfe()/betwfe()/etwfe()/twfeCovs()”; if it fails on a valid fit, that is always a bug and the error propagates. -
Layer B (offset-aware D-inverse). A new internal helper
getFirstIndsFromOffsets(cohort_offsets_int, T)(inR/utility.R) parallelsgetFirstInds(R, T)but accepts an arbitrary strictly-increasing vector of cohort offsets. The helper formulafirst_inds[r] = 1 + sum_{k < r} (T - offsets[k] + 1)reduces to the existing1 + (r - 1) * (2 * T - r) / 2whenoffsets = c(2, 3, ..., R + 1).eventStudy()derives the actual offsets fromnames(x$cohort_probs)(treatment-start years) andx$internal$first_year(a new internal slot exposed byprepXints()); if the cohort labels are not integer- coercible (syntheticgenCoefs-based fixtures) the path falls back togetFirstInds(R, T), preserving byte-identical results on the synthetic test suite. The validity setV_eat each event time is reworked fromseq_len(R) <= T - 1 - eto the offset-awarecohort_offsets_int <= T - efor the same reason. Issue #174.
-
Layer A (no silent swallow). The
Internal
- New
$internal$first_yearslot onfetwfe,etwfe,betwfe,twfeCovsresults (integer or numeric scalar; the first (earliest)time_varvalue in the panel afteridCohorts()processing). Surfaced fromprepXints(). Used byeventStudy()to map cohort labels to panel-time-index offsets. Added to all four.EXPECTED_INTERNAL_SLOTS_*vectors and documented in the estimators’@returnblocks. Pure-additive change.
Breaking change for v1.13.3-or-earlier serialized fits
- The new
$internal$first_yearslot is added to.EXPECTED_INTERNAL_SLOTS_<CLASS>on all four estimator classes, so.validate_<class>()stops with"Missing slot(s): first_year"whenprint()orsummary()is called on a fit serialized under v1.13.3 or earlier. This matches the established convention from #85 (the validator framework) and recurs with every prior.EXPECTED_INTERNAL_SLOTS_*addition (most recentlyvariance_componentsin #141 / #146 / PR #163, v1.12.0). Users with saved v1.13.3 fits need to re-fit under v1.13.4.
Version 1.13.3 (2026-05-28)
Performance
- Vectorized
my_scale()inR/utility.R(called once perfetwfe()/etwfe()/betwfe()/twfeCovs()call fromprep_for_etwfe_regression()). Replaced the per-columnapply(x, 2, sd)R-level loop with a single-passcolSums(x_c^2)- based variance, and the twosweep(..., FUN = "-" | "/")calls with broadcastedrep(..., each = nrow(x))subtract / divide. ~2.4x speedup on the function itself (10000 x 50 fixture). Output is numerically identical to the prior implementation up to floating-point reorder noise (~1e-15) on realistic full-rank inputs. The byte-identical-BIC regression test pinned in v1.13.0 (#164) passes byte-identically post-this-change, confirming the production code paths are unaffected. Issue #167.
Version 1.13.2 (2026-05-28)
Performance
- Vectorized
idCohorts()’s per-unit row-filter loop inR/utility.R(previouslyO(N^2 * T)due to adf[df[, unit_var] == s, ]filter inside afor (s in units)loop). The post-fix path sorts the data frame once by(unit_var, time_var), tabulates per-unit row counts, and runs the balance check, absorbing-state check, and cohort assignment via column-wise operations on a reshapedT x Ntreatment matrix. Same observable behavior: identical balance and absorbing-state violation messages (single groupedstop(), same lexicographically-sorted truncated listing), identical first-period-treatedwarning(), identical return shape.idCohorts()itself is ~15x faster at N = 2000, T = 5; end-to-endfetwfe()at the Phase B fixture speeds up an additional 1.3x on top of #165, for a combined 7.6x vs. pre-#165. Issue #166.
Version 1.13.1 (2026-05-28)
Performance
- Replaced an explicit
kronecker(diag(N), Omega_sqrt_inv) %*% (y | X_mod)GLS whitening step in.estimate_variance_and_gls()with the block-apply identity(I_N kron A) %*% vec(M) = vec(A %*% M). The pre-fix code allocated an(N*T) x (N*T)Kronecker matrix on every call (50 MB at N = 500, 800 MB at N = 2000) before multiplying it byyandX_mod; the post-fix code allocates nothing larger than the inputs and outputs. End-to-end measured speedups on the Phase B fixture: 3.6× at N = 500 / 5.7× at N = 2000. The identity is algebraically exact and verified bit-identical (16-digit parity) on randomized fixtures; new direct test intests/testthat/test-gls-kronecker-block-apply-165.R. The speedup carries verbatim toetwfe(),betwfe(), andtwfeCovs()(all four estimators share the GLS step). Issue #165.
Version 1.13.0 (2026-05-28)
Breaking change
The default lambda_selection for fetwfe() and betwfe() is now "cv" (10-fold cross-validation on cv.grpreg), replacing the previous BIC-based selection. Empirical validation across multiple simulation regimes (#164) showed that the prior BIC selection produced biased overall-ATT estimates at moderate sample sizes — 95% Wald CI coverage was as low as 0.00 at N = 2000 with the paper’s second-simulation parameters, and collapsed from 0.83 to 0.33 between N = 120 and N = 500 in the paper’s first-simulation high-dim regime. The new CV default restores near-nominal coverage in every tested regime and additionally has the lowest MSE in the high-dim regime that FETWFE was originally designed for.
To recover the prior behavior:
This is a numerical-results-change-for-default-callers release. Confidence intervals and point estimates from the new default may differ substantially from prior versions on the same data; see the inference vignette section “Choosing the bridge penalty parameter” for guidance.
New features
-
lambda_selectionparameter onfetwfe()andbetwfe()(and theWithSimulatedDatawrappers). -
cv_foldsandcv_seedparameters control the CV fitting (defaults10LandNULL; the latter defaults internally toas.integer(N * T)for per-dataset reproducibility without requiring the user to specify a seed). - Result objects include new top-level slots
lambda_selection,cv_folds,cv_seed.glance()exposes all three. -
inference_vignette.Rmdupdated with a new “Choosing the bridge penalty parameter” subsection documenting the default change and the BIC opt-out.
Issue #164.
Version 1.12.0 (2026-05-27)
Breaking changes
The default
att_sevalue now uses the tight Gaussian variancesqrt(att_var_1 + att_var_2)from paper Theoremte.asym.norm.thm(c) under Assumption (Psi-IF). (Psi-IF) is satisfied by the package’s default cohort sample-proportions estimatorhat_pi_r = N_r / N, by multinomial-logit MLE, by any GLM onW | X, and by kernel/series regression of1{W = r}onX, so the new default SE is asymptotically exact for the package’s default estimator out of the box. Previous versions returned the conservative Cauchy-Schwarz upper boundsqrt(att_var_1 + att_var_2 + 2 * sqrt(att_var_1 * att_var_2))as the same-data default. The new default SE is strictly narrower; the corresponding CIs are strictly tighter. To recover the prior conservative behavior, passse_type = "conservative"(intended for non-(Psi-IF) propensity-score estimators like Robins-Rotnitzky-augmented doubly-robust, which the package does not currently implement).se_type = "cluster"users will also see a numerical shift inatt_sebetween 1.11.7 and 1.12.0. The cluster path’sV_1(the Liang-Zeger cluster-sandwich quadratic form) andV_2(the propensity-score contribution) are now combined via the same tight formulasqrt(V_1 + V_2)by default. To recover the prior conservative cluster behavior, passse_type = "conservative"(the cluster sandwich is then no longer applied — the conservative path uses the model-based V_1 and the Cauchy-Schwarz combination).
New features
New named slots on the fitted-object’s
internal$variance_componentsblock expose the paper’s variance decomposition by name.V_1is the Kock-2013 regression-coefficient variance contribution (sigma^2 alpha' Sigma^{-1} alpha);V_2is the propensity-score variance contribution (v_psi(beta_0, S)); both correspond to the per-unit paper-notation rescalingV_1 = N * att_var_1,V_2 = N * att_var_2.Unit-scaled variance estimators
tilde_v_N := hat_v_N / Tfrom paper line 2006 exposed alongsideV_1/V_2on the variance-components block.tilde_v_Nis the headline value backingatt_se; the four cataloged unit-scaled variance estimators (tilde_v_N_C,tilde_v_N_C_pi_hat,tilde_v_N_C_pi_hat_cons,tilde_v_N_cons) correspond to the paper’s equationsv.n.r.t.att.const,v.n.r.t.att.rand,v.n.r.t.att.rand.cons, andvar.est.kock.wooldridge.subgauss.consrespectively. The Wald CI is[hat_T_N +- qnorm(1 - alpha/2) * sqrt(tilde_v_N / N)](paper Eq.conf.int.form). Issue #146.inference_vignette.Rmdreframed: same-data inference is now Gaussian under (Psi-IF) by default; the conservative subgaussian path is documented as the fallback for non-(Psi-IF) propensity-score estimators. The vignette also walks through the new paper-notation slots (V_1,V_2,tilde_v_N).
Version 1.11.7 (2026-05-26)
New features
-
The
covsargument onfetwfe(),etwfe(),betwfe(), andtwfeCovs()now accepts a one-sided formula in addition to the long-standing character vector. Both forms produce identical fits:Mirrors the convention used by
did::att_gt(xformla = ...). Only additive bare variable names are supported in the formula form (e.g.,~ x1 + x2 + x3); interactions (x1:x2,x1 * x2) andI()transformations are rejected with a clear pointer to compute derived variables in the data frame first. Issue #28.
Version 1.11.6 (2026-05-26)
New features
-
plot.fetwfe(),plot.etwfe(),plot.betwfe()are new S3 methods returning aggplotobject for either event-study coefficients (default;type = "event_study", preserving the pre-PR behavior of the predecessor event-study-onlyplot.<class>methods) or per-cohort ATTs (type = "catt"). Mirrors the visualization style ofdid::ggdid()from the Callaway-Sant’Annadidpackage, giving users a single-call route from fitted object to publication-ready visualization. For the bridge-penalty estimators (fetwfe/betwfe) in the CATT view, points are shape- and color-coded by whether the bridge penalty left the cohort’s ATT nonzero (selected = TRUE) or zeroed it (selected = FALSE); foretwfe(no selection), styling is uniform.ggplot2is required (Suggests dependency) – the helper stops with an actionable message if missing.twfeCovsis not supported by this PR (see #58 for the broader treatment oftwfeCovsclass methods). Closes #29.
Version 1.11.5 (2026-05-26)
New features
-
print()andsummary()forfetwfe(),etwfe(), andbetwfe()fits now include an event-study preview block alongside the existing ATT and CATT blocks, surfacing per-event-time treatment-effect estimates in the routine display. The block uses the same snake_case column convention aseventStudy(result)(event_time,n_cohorts,estimate,se,ci_low,ci_high,p_value). Truncation is controlled by a newmax_event_timesargument (defaulting togetOption("<class>.max_event_times", 10)forprint()and 20 forsummary()), parallel to the existingmax_cohortsknob.summary()results also carry a newevent_studyfield betweencattandmodel_info. The event-study is computed on demand (no fit-time cache); ifeventStudy()would error on the fitted object (no realistic configuration currently triggers this), the block is silently omitted rather than crashing the display.twfeCovsis unaffected –eventStudy()does not support it. Issue #138.
Version 1.11.4 (2026-05-26)
New features
-
etwfe(),betwfe(), andtwfeCovs()results now expose an$internallist containing the design-machinery slots (X_ints,y,X_final,y_final,calc_ses), matching the structurefetwfe()already provided. Downstream consumers can now use a single canonical access path (result$internal$<slot>) across all four estimator classes. The same slots remain available at top level (e.g.,result$X_ints) for backward compat with existing user scripts; no scripts are broken by this change. Issue #144.
Version 1.11.3 (2026-05-26)
Defensive improvements
-
tidy.eventStudy()(R/broom_methods.R) now reports the missing column name when its input is missing a required column, parallel to the guard added totidy.cohortStudy()in 1.11.1. Previously a user-mutatedeventStudyframe produced a cryptic “arguments imply differing number of rows” error fromdata.frame(); now the failure localizes to “tidy.eventStudy(): input is missing required columns: …”. Required columns:event_time,n_cohorts,estimate,se,p_value. CI columns (ci_low,ci_high) are NOT required — this method computes its own CIs fromestimate +/- z * se. Issue #151.
Version 1.11.2 (2026-05-26)
Defensive improvements
- The five cluster-sandwich quadratic-form floor sites in the variance machinery (PR #111, item 9; the count was six before PR #118 consolidated
getCohortATTsFinalOLS()intogetCohortATTsFinal()) now layer a two-tier diagnostic on top of the existingmax(., 0)floor: awarning()fires when the quadratic form is more negative than-1e-10(clearly outside floating-point noise) and astop()fires when it is more negative than-1(catastrophic; outside any plausible SE-squared magnitude in difference-in-differences applications). On well-conditioned data the behavior is unchanged. The diagnostic surfaces latent bugs that would previously have silently producedSE = 0. Issue #139.
Version 1.11.1 (2026-05-25)
New features
-
cohortStudy(result)is a new function-style accessor for per-cohort average treatment effects, parallel toeventStudy(). It returns the same information available viaresult$catt_dfin a discoverable function with its own help page (?cohortStudy). Usetidy(cohortStudy(result))(withbroomloaded) for broom-shape output suitable formodelsummaryand similar consumers. The returned object carries classc("cohortStudy", "catt_df", "data.frame"): thecohortStudyclass dispatchestidy(); thecatt_dfclass preserves the helpful-error layer for pre-1.11.0 column-name access; thedata.framebase preserves the standard data-frame methods.
Version 1.11.0 (2026-05-25)
Breaking changes
-
The columns of
result$catt_dfhave been renamed to a snake_case convention that matches the columns ofeventStudy(result):Old name New name CohortcohortEstimated TEestimateSEseConfIntLowci_lowConfIntHighci_highP_valuep_valueThe
selectedcolumn (fetwfe/betwfeonly) is unchanged. Broom output viatidy(result)is also unchanged (still broom-style:estimate,std.error,statistic,p.value,conf.low,conf.high).Update existing code that references
result$catt_df[["Estimated TE"]]etc. Thecatt_dfnow carries S3 classc("catt_df", "data.frame")and provides helpful-error methods on[[,$,[that intercept the old column names and point to the new name — so most migration friction surfaces as an actionablestop()rather than a silentNULL. Standard data-frame operations (print(),head(),summary(),dim(), row indexing) all dispatch through todata.framemethods unchanged. NSE access (dplyr / ggplot / subset) strips thecatt_dfclass as usual and surfaces the standard “object not found” error.The cosmetic side of the rename: column headers in the
print()/summary()CATT preview blocks now appear in snake_case. The snapshot tests intests/testthat/_snaps/print-method-snapshot.mdhave been re-recorded.
Version 1.10.1 (2026-10-31)
CRAN release: 2026-11-20
- Changed the tests that compared two separately computed results exactly to compare them at the default tolerance instead. Intel MKL BLAS does not guarantee bitwise-identical results across runs, and two of these comparisons failed the CRAN MKL check. No change to the package’s code (#541).
Version 1.10.0 (2026-05-21)
CRAN release: 2026-05-23
- CRAN release. Version 1.10.0 is the first CRAN release since 1.5.0; it consolidates the 1.5.1-1.9.33 development series documented in the entries below and introduces no new code beyond 1.9.33. The changes most likely to matter when upgrading from the 1.5.0 CRAN release:
- Behavior change. Version 1.9.1 corrected the internal variance-component estimator, which had collapsed the unit-level variance component to nearly zero and degenerated the GLS weighting step. Both standard errors and point estimates shift after upgrading; see the 1.9.1 entry for details.
- New functionality:
eventStudy()withplot()methods (1.7.0); broomtidy()/glance()/augment()methods (1.9.0); an experimental cluster-robustse_type = "cluster"option (1.6.0); theallow_no_never_treatedargument (1.5.6); per-cohortP_valueandselectedcolumns (1.5.5). - Additional standard-error and correctness fixes (1.8.0, 1.9.2-1.9.13), extensive internal hardening, and documentation and vignette updates.
Version 1.9.33 (2026-05-20)
- Replaced the remaining
bacondecomp::divorceexamples (the four estimators’ help-page examples and the package’s quick-start example) withbacondecomp::castleexamples, matching the main vignette; fixed a stale citation year in the package documentation.
Version 1.9.32 (2026-05-20)
- Replaced the main vignette’s flagship empirical example: the
bacondecomp::divorceanalysis (on which FETWFE selects a null under the corrected variance estimator, on a rank-deficient panel) is replaced by abacondecomp::castleanalysis of castle-doctrine laws and homicide, which yields a non-null, literature-consistent result. The vignette’s simulated example now also generates and uses time-invariant covariates. Vignette content only; no change to package behavior.
Version 1.9.31 (2026-05-20)
- Corrected the documented output column names for
attgtToFetwfeDf()andetwfeToFetwfeDf(): their@returnand@paramblocks listedtime/unit/y, but the converters producetime_var/unit_var/response(theout_namesdefaults). Documentation fix only; no change to either function’s behavior.
Version 1.9.30 (2026-05-20)
- Documentation and cleanup sweep from the 2026-05-19 internal review: documented the
cohort_timesslot in thegetTes()return value; documented these_typeargument in the four internal*_corefunctions; extended the documentation-slot-parity test to covergetTes(),genCoefs(), andsimulateData(); corrected a misleading factor-encoding comment inprocessFactors(); removed a redundant cohort-count assertion inprep_for_etwfe_core(); and fixed two stale function names incran-comments.md. Documentation and cleanup only; no user-facing behavior change.
Version 1.9.29 (2026-05-20)
- Added regression-test coverage for four code paths flagged by the 2026-05-19 internal review:
processCovsfirst-period covariate broadcasting when unit IDs are not already in sorted order, cluster-robust standard errors on auto-truncated (all-treated) panels foretwfe()andtwfeCovs(),augment()row-order invariance after first-period-treated units are auto-dropped, and thegetCohortATTsFinal()psi_matrow-count contract across the OLS and bridge calling conventions. Test-only; no user-facing behavior change.
Version 1.9.28 (2026-05-19)
- Consolidated three small shared helpers across the estimator cores into
R/utility.R(GitHub #119, follow-up to #118): the 4-waygrpreg::gBridgedispatch + lambda-path diagnostic block (formerly duplicated acrossR/fetwfe_core.RandR/betwfe_core.R), the treat-index / treat-interaction-index computation block (formerly across all three*_core.Rfiles), and the cohort-count rank-condition check (formerly acrossR/fetwfe.RandR/twfeCovs.R). Pure internal refactor with one minor user-visible change:twfeCovs()’s warning / stop message under the cohort-count rank condition now uses the stronger “the design matrix is rank-deficient” wording thatetwfe()always used, converging on the mathematically accurate form.
Version 1.9.27 (2026-05-19)
- Unified the internal
getCohortATTsFinal()and previously-separategetCohortATTsFinalOLS()helpers inR/variance_machinery.Rinto a single function controlled by the existingfusedflag plus a new requiredinclude_selectedargument (GitHub #118). Pure internal refactor: cohort-ATT point estimates, SEs, p-values, and confidence intervals are byte-identical forfetwfe(),etwfe(),betwfe(), andtwfeCovs()on every existing test fixture. Reduces ~140 LOC of duplication and consolidates the surface area for future variance-estimator fixes.
Version 1.9.26 (2026-05-19)
- Fixed four roxygen-comment typos surfaced by the 2026-05-19 periodic code review (GitHub #115):
#"instead of#'on thesimulateData()andsimulateDataCore()docstrings inR/gen_data.R, and an unmatched backtick beforefetwfe()in theattgtToFetwfeDf()andetwfeToFetwfeDf()descriptions inR/convert_dfs.R. The latter fix restores correct inline-code rendering inman/attgtToFetwfeDf.Rdandman/etwfeToFetwfeDf.Rd; the former is a latent typo that roxygen2 happened to parse around.
Version 1.9.25 (2026-05-19)
- Reorganized the
R/source tree so each file’s contents match its name (GitHub #82). Pure file-move refactor: zero behavior change, NAMESPACE unchanged, all 1909 tests pass. Specifically:- Renamed
R/ols_calcs.RtoR/variance_machinery.R(viagit mv) and consolidated the FETWFE-side variance helpers (getTeResults2,getPsiRFused,getSecondVarTermDataApp,getCohortATTsFinal) that previously lived inR/fetwfe_core.Rso all OLS- and FETWFE-side variance machinery now shares one home. - Created
R/design_matrix.Rfor design-matrix construction (prepXints,processCovs,processFactors,addDummies,generateFEInts,genTreatInts,genXintsData,genTreatVarsRealData) - moved fromR/etwfe_core.R. - Created
R/fusion_transforms.Rfor the five fusion-transform matrix generators (transformXintImproved,untransformCoefImproved,genBackwardsFusionTransformMat,genBackwardsInvFusionTransformMat,genInvTwoWayFusionTransformMat, andgenFullInvFusionTransformMat) - moved fromR/fetwfe_core.RandR/core_funcs.R. - Split
R/gen_funcs.Rinto three smaller files:R/gen_coefs.R(coefficient generators + truth extraction:genCoefs,genCoefsCore,getTes,getActualCohortTes),R/gen_data.R(data simulation pipeline:simulateData,simulateDataCore), andR/sim_helpers.R(internal sim helpers). - Moved
etwfeWithSimulatedData()fromR/etwfe_core.RtoR/fetwfe.R, alongsideetwfe()itself (matching the pattern ofbetwfeWithSimulatedDataco-located withbetwfe_core, etc.). - Moved
prep_for_etwfe_core()fromR/etwfe_core.RtoR/core_funcs.R(alongside its siblingprep_for_etwfe_regression()). - Moved the shared input-validator helpers
.collect_etwfe_input_violations()and.format_input_violations()fromR/etwfe_core.RtoR/utility.R(co-located with.truncate_violations()). -
R/etwfe_core.RandR/fetwfe_core.Rnow contain only their namesake_coreestimator plus the corresponding input validator (and, for fetwfe,getBetaBIC).
- Renamed
Version 1.9.24 (2026-05-19)
- Reconciled three strict-vs-lenient validator inconsistencies (GitHub #109, follow-up to #84 item 12):
-
lambda.max(Case 1): Tightened the innerfetwfe_corecheck fromlambda.max >= 0tolambda.max > 0to match the outercheckFetwfeInputsinvariant. No user-visible behavior change — the inner check is downstream of the outer and was effectively dead code (any caller already validated> 0via the entry point). -
sig_eps_c_sq = 0(Case 2): LoosenedsimulateData()(and its inner helpertestGenRandomDataInputs()) to acceptsig_eps_c_sq = 0, matching the validator surface used byfetwfe()/etwfe()/betwfe()/twfeCovs(). Methodologically,sig_eps_c_sq = 0yields a panel with no unit-level random effects (rnorm(N, sd = 0) = rep(0, N)). Backward-compatible additive change — previously-rejected inputs are now accepted. -
R >= 2(Case 3): Tightened the upstreamR >= 1checks atR/core_funcs.R::check_etwfe_core_inputsandgenFullInvFusionTransformMattoR >= 2, matching the user-facing helpful-error check atR/etwfe_core.R:1127(“Only one treated cohort detected…”). No user-visible behavior change —R = 1was already rejected with a clearer message downstream. Single-treated-cohort support (R = 1) is filed separately as #112.
-
Version 1.9.23 (2026-05-19)
-
Closes out the remaining items of GitHub #84 (the 2026-05-17 periodic code review) in one bundled PR: 11 items across three categories (test coverage, defensive guards, and performance). Internal changes only; no public-API drift.
Test coverage (items 1, 3, 5, 6, 7): closes 5 untested-path gaps.
eventStudy()now has direct coverage on auto-truncated panels; the q >= 1 ridge-regimeatt_se = NAcontract has tightened assertions coveringatt_p_value,catt_ses, and the CI columns ofcatt_df;augment.<class>()is now exercised with bothse_type = "cluster"andindep_counts-bearing fits; and the end-to-end REML + cluster-SE pipeline is verified non-conflicting on a single fit.Defensive guards (items 8, 9, 10): defense-in-depth additions to catch future refactor regressions. (1)
.select_att_branch()’s etwfe/twfeCovs unconditional SE-non-NA guard is now gated oncalc_ses(today onlyq >= 1producescalc_ses = FALSE, but the gate hardens against a future code path that routes acalc_ses = FALSEnon-bridge fit through the indep-counts branch). (2) The 6 cluster-sandwich quadratic-form computation sites now floor at zero (max(quad_form, 0)); the Liang-Zeger sandwich is PSD in exact arithmetic, but therowsum-based meat aggregation could in principle round a near-zero form to a tiny negative, which would NaN downstreamsqrt()s. (3).compute_cluster_robust_sandwich()nowtryCatch-es thesolve(crossprod(X_S_centered))call to surface the same “Gram matrix corresponding to selected features is not invertible” message asgetGramInv()rather than a raw Lapack “system is exactly singular” trace.-
Performance (items 15, 16, 18): (1)
processCovs()(the covariate-cleanup helper called by every estimator entry point) is vectorized. The old per-unit nested-loop pattern was O(N^2 * T * d); the rewrite uses a single first-period slice +rep(..., each = T)broadcast, dropping the cost to O(N * T * d). Output is bit-identical on the standard test fixtures. (2).estimate_variance_and_gls()now computesOmega^(-1/2)via a closed-form spectral decomposition (Omega = sig_eps_sq * I_T + sig_eps_c_sq * J_Thas eigenvaluesig_eps_sq + T * sig_eps_c_sqonspan(1_T)andsig_eps_sqon its orthogonal complement) instead ofexpm::sqrtm(solve(Omega)). The closed form is exact up to floating-point and eliminates the runtimeexpmdependency;expmmoves fromImports:toSuggests:(it’s still used for the numerical-equivalence test).-
.compute_cluster_robust_sandwich()’s N-loop is replaced with a vectorizedrowsum()+crossprod()assembly, equivalent to the pre-rewrite loop bit-for-bit modulo floating-point summation order.
-
Items 2 (test coverage already provided), 12 (deferred as GitHub #109), and 17 (deferred as GitHub #110, pending benchmark) were scoped out of this PR. Items 4, 11, 13, 14 shipped previously (PRs #108, #105, #106, #107).
Version 1.9.22 (2026-05-19)
-
tidy.FETWFE_tes()now acceptsconf.intandconf.levelarguments for broom-convention parity with the siblingtidy.fetwfe(),tidy.etwfe(),tidy.betwfe(), andtidy.eventStudy()methods. Defaults areconf.int = TRUE(preserves pre-fix output — NA-valuedconf.low/conf.highcolumns included) andconf.level = 0.95. Whenconf.int = FALSE, the CI columns are omitted entirely.conf.levelis validated but unused (there is no sampling distribution for a population truth). GitHub #84 item 14.
Version 1.9.21 (2026-05-19)
- Added compact
printmethods forFETWFE_simulated(output ofsimulateData()) andFETWFE_coefs(output ofgenCoefs()). Pre-fix,print(simulateData(...))fell through toprint.listand dumped the fullN*T x pdesign matrix — potentially hundreds of MB for medium-sized panels. The new methods print a compact dimensions summary (N, T, R, d, p, cohort sizes, noise variances forFETWFE_simulated; R, T, d, beta length, theta sparsity, seed forFETWFE_coefs). Live behavior is unchanged for everything except the printed output. GitHub #84 item 13.
Version 1.9.20 (2026-05-19)
- User-facing input-validation error messages for the four estimator entry points (
fetwfe(),etwfe(),betwfe(),twfeCovs()) are now actionable instead of cryptic (GitHub #84, item 11). The legacyError: is.character(time_var) is not TRUEfamily produced bystopifnot()is replaced with a named, multi-linestop()message of the formInvalid inputs:\n - <arg>: <expected>; got <received>, where ALL malformed args are collected on a single call so the user sees every violation at once instead of one error round-trip per arg. Two new internal helpers inR/etwfe_core.R—.collect_etwfe_input_violations()and.format_input_violations()— absorb the collect-and-render plumbing;checkEtwfeInputs()andcheckFetwfeInputs()(the latter atR/fetwfe_core.R) became thin wrappers around them. Per-arg failures cascade within an arg (the first failure in an arg’s check chain short-circuits — e.g.,time_var %in% colnames(pdata)isn’t run iftime_varisn’t a length-1 character) but collect independently across args. NULL inputs are handled cleanly (class(NULL) = "NULL",length(NULL) = 0interpolate fine). The PR #103 snapshot guardrail (which locked the legacyis.foo() is not TRUEstrings) was deliberately re-blessed with the new helpful messages; the snapshot mechanism continues to lock the new contract against accidental drift. Internal validators (check_etwfe_core_inputs(),prepXints()) were intentionally left as tersestopifnot()s — they check post-prep invariants, not user input. Item 12 of #84 (strict-vs-lenient reconciliations:lambda.max >= 0vs> 0;sig_eps_c_sq = 0;R >= 1vsR >= 2) is deferred to a follow-up since it involves API-behavior decisions rather than UX wording.
Version 1.9.19 (2026-05-19)
- Internal consolidation of the input/output pipeline shared by the four public estimator entry points
fetwfe(),etwfe(),betwfe(), andtwfeCovs()(GitHub #79). Two new internal helpers inR/utility.R—.run_estimator_input_prep()and.select_att_branch()— absorb the verbatim Steps 3-5 (input validation + auto-truncation + design-matrix prep) and Step 8 (“pick from in-sample vs indep ATT/SE/cohort-probs”) that were previously copy-pasted across the four entry points. The four caller-side rewrites trim ~250 LOC of duplication while leaving the eleven other steps (match.arg, original-covs capture, core call, rank-deficiency warning loop, p-value, output-list build, validator, class assignment) inline. No public API change; the snapshot guardrail from v1.9.18 (PR A, #103) confirms all four validators’ error messages remain byte-identical. The new helpers carry@noRd/@keywords internaland do not appear in the exported docs surface.
Version 1.9.18 (2026-05-19)
- Internal refactor of
R/core_funcs.R::prep_for_etwfe_regression()(GitHub #81). The 237-line god function is split into four named helpers —.estimate_variance_and_gls(),.collapse_design_for_twfe_covs(),.append_ridge_rows(),.compute_cohort_probs()— with the orchestrator reduced to an ~100-line sequence of helper calls. No public API change; all four caller sites (fetwfe_core(),etwfe_core(),betwfe_core(),twfeCovs_core()) continue to unpack the same 12-field result list. Four direct return-shape tests added intests/testthat/test-prep-helpers-81.Rto lock the helpers’ contracts against future drift.
Version 1.9.17 (2026-05-19)
- Small consistency-and-cleanup bundle (GitHub #76). Eight items:
-
twfeCovs()now returns an object with class"twfeCovs", with minimal-stubprint.twfeCovs()andcoef.twfeCovs()methods to bring it into parity with the three sibling estimators (fetwfe,etwfe,betwfe). A newR/twfeCovs_class.Rfile holds these alongside a NULL doc stub. The class dispatcher in.assert_estimator_object()was extended to recognizetwfeCovs. Liveprint()andcoef()behavior is preserved exactly. - Three
augment.*docstrings (forfetwfe,etwfe,betwfe) were rewritten to reflect the actual auto-trim + auto-sort behavior of.augment_estimator_output(). The pre-fix docstrings claimed the user must pre-trim and pre-sort; that has been wrong since #27. (3a)checkEtwfeInputs()@titlenow correctly references theetwfe/betwfe/twfeCovsfunctions (was:fetwfe). - Deleted the unused, internal
genInvFusionTransformMat()helper. Confirmed zero callers before removal. (7a) Removed Test 4 fromtests/testthat/test-fetwfe-var2-fix.R: its “hand-computed” reference reproduced the helper’s own loop structure step-for-step, so passing only confirmed the helper was self-consistent, not that it matched an independent target. Tests 2 (Monte Carlo validation) and 3 (anti-regression) are the load-bearing var2 coverage. (7b) Demoted the tautological.fitted + .resid == yround-trip expectation intests/testthat/test-augment-treatment-parity.Rto a comment. The load-bearing row-order check is preserved. (8a) Dropped unusedpargument fromgetCohortATTsFinal(). (8b) Dropped unusedpsi_matandtesarguments fromgetSecondVarTermDataApp(), with corresponding test call-site updates. (8c) Dropped the deadfused = FALSEbranch (and thefusedargument) fromgetSecondVarTermDataApp(), along with the corresponding roxygen@param fusedblock and stale docstring sentence about the fused-only restriction.
-
- The issue’s Item 5 (NULL-alpha defensive fix in
tidy.*) was surveyed and skipped: the post-#85 constructor validators catch NULLalphabefore anytidy.*()method runs, so the proposed defensive default would be unreachable. See.plans/cleanup-bundle-76/PLAN.mdDecision D7 for the full trace.
Version 1.9.16 (2026-05-18)
- Extracted two micro-helpers to
R/utility.Rand standardized one threshold convention (GitHub #83):-
.cohort_block_inds(r, R, first_inds, num_treats)replaces 6 inlinefirst_ind_r <- first_inds[r]; last_ind_r <- if (r < R) ... else num_treatsconstructions acrossR/core_funcs.R,R/fetwfe_core.R,R/gen_funcs.R, andR/ols_calcs.R. -
.multinomial_cov(probs)replaces 3 inlineSigma_pi_hat <- -outer(probs, probs); diag(...) <- probs * (1 - probs)blocks acrossR/fetwfe_core.R,R/ols_calcs.R, andR/event_study.R. -
R/core_funcs.R’s 4 occurrences of10^(-6)replaced with1e-6to match the rest of the package (bit-identical value; pure cosmetic). No user-visible behavior change.
-
Version 1.9.15 (2026-05-18)
- Consolidated the cluster-robust sandwich assembly across 4 call sites (
getCohortATTsFinalOLS,getCohortATTsFinal,.event_study_etwfe_betwfe,.event_study_fetwfe) into a single internal helper.assemble_cluster_robust_sandwich()inR/ols_calcs.R. No user-visible behavior change; the sandwich matrix andtreat_block_maskoutputs are bit-identical to v1.9.14. The consolidation reduces the drift surface that produced the v1.9.510e-6threshold typo (#56) from 4 sites to 1. Resolves #78.
Version 1.9.14 (2026-05-18)
- Refactored the four “no features selected” early-exit blocks in
fetwfe()andbetwfe()(intercept-only and no-treatment cases for each estimator) to share a single internal helper.build_selected_out_result()inR/core_funcs.R. No user-visible behavior change: the return-list shape, field ordering, and values are byte-identical to v1.9.13. The consolidation eliminates a 4-way drift surface that produced 9 staleq < 1references in v1.9.5 (#56). Resolves #80.
Version 1.9.13 (2026-05-18)
- Tightened
idCohorts()’s panel-balance check to catch units with the right row count but duplicate or missing time periods (GitHub #75). A unit with rows at times(1, 2, 2)andT = 3previously passed silently, causing a confusing downstream failure inprocessCovs(). The new check requires bothnrow == Tand exact time coverage; the violation message includes both counts. The parallel balance check inprocessCovs()(defense-in-depth) is tightened to match.
Version 1.9.12 (2026-05-18)
- Fixed a silent bug in
betwfe(..., add_ridge = TRUE)(GitHub #74): the L2 ridge augmentation rows were applied in the FETWFE fusion-transform basis (D_inverse) instead of the identity basis BETWFE requires. Default-off, but affected users who setadd_ridge = TRUEto escape rank-deficient designs. Also madeis_fetwfea required argument in the internalprep_for_etwfe_regression()helper so the same bug class cannot recur silently.
Version 1.9.10 (2026-05-17)
- Fixed a cross-method consistency bug in
eventStudy()(GitHub #73): the function previously reported finite SEs and p-values forq >= 1fits even though the correspondingfetwfe()/betwfe()objects correctly returnatt_se = NAin that regime (the bridge oracle property is required for the model-based SEs). After this fix,eventStudy()propagates the fit’scalc_sesstatus: when the fit has no valid SEs,eventStudy()returns NA SEs and NA p-values, matching the parent object’s contract. The point estimates remain valid (and finite) in both regimes. Same fix applies underse_type = "cluster". - Added internal method-entry preconditions for cross-class consumers (
eventStudy,augment,tidy,glance,plot,coef). Each such method now re-validates the input fitted object before computing on it, catching hand-modified or programmatically-malformed inputs early with a clear error message. Foundation PR beta of three (with Foundation alpha #85 already shipped and Foundation gamma #87 drift-sentinel subagent queued). Resolves GitHub #86.
Version 1.9.9 (2026-05-17)
- Added internal constructor validators for each estimator class (
fetwfe,etwfe,betwfe,twfeCovs). Each entry-point function now runs.validate_<class>(out)immediately before class assignment. The validators encode the documented cross-slot contracts: slot inventory (matches@returndocs), SE consistency (ifcalc_sesis FALSE thenatt_seandcatt_sesmust all be NA), selection consistency (att_selectediffatt_hat != 0for the classes that have it), p-value NA-derivation, catt_df shape, cohort-probability structural sanity, beta_hat / y / X_ints dimensions, lambda monotonicity (for the bridge estimators), and type sanity. Resolves GitHub #85. This is the first of three foundation PRs (with #86 method-entry preconditions and #87 drift-sentinel subagent) designed to prevent the drift class that produced multiple recent cleanup PRs. - No public API change. No behavior change on well-formed objects: the validators only fire if an object would be malformed (which currently cannot happen via the public estimator path; verified empirically against q in {0.5, 1, 2} and the all-zero-theta fallback). Shared contract-checking helpers live in
R/class_helpers.R; the per-class validators live inR/<class>_class.R(orR/twfeCovs.Rfor twfeCovs pending a class file in #76).
Version 1.9.8 (2026-05-16)
- Documentation sweep: refreshed
@returnblocks onetwfe(),betwfe(),twfeCovs(), and their*WithSimulatedData()wrappers to match current slot inventories (slots added since v1.5.5 / v1.7.0 / v1.9.0 were missing from the docs). Also added thetheta_hatsub-slot to theinternallisting forfetwfe()andfetwfeWithSimulatedData(). Added@examplesblocks toetwfe()andtwfeCovs()(the other public estimator entry points already had them). Removed copy-paste references to a bridge-penaltyqparameter fromtwfeCovs.Randetwfe_core.Rdocs (neither function takes aqargument; both are pure OLS). Removed a self-referential@inheritParams getTeResults2line fromgetTeResults2’s own documentation block. Cleaned upetwfe_core()andtwfeCovs_core()@returnblocks, which previously listed bridge-only slots (theta_hat,lambda.*) those functions never return. Updated a stale mock value intest-class-helpers.R(se_type = "standard"→"default"to mirror the livematch.arg()choice). Resolves GitHub #55. -
attgtToFetwfeDf()andetwfeToFetwfeDf()gain averbose = FALSEargument; the previously-unconditional “Dropped N unit-period(s) treated in the first period” message is now gated onverbose. Default-silenced to match the project convention that non-interactive code paths should not emit console output without opt-in. Users who want the message back can call withverbose = TRUE.
Version 1.9.7 (2026-05-16)
- Internal cleanup pass: dropped four unused parameters from internal helpers, removed one block of redundant self-validating assertions, and corrected a typo in an internal helper name. No public API changes; no behavior changes. Resolves GitHub #59.
-
idCohorts()(R/utility.R) no longer accepts the unusedcovsargument. Two internal call sites updated. -
genTreatVarsSim()(R/gen_funcs.R) no longer accepts the unuseddargument. One internal call site updated. -
getPsiRUnfused()(R/ols_calcs.R) no longer accepts the unusedgram_invargument. Three internal assertions ongram_invdimensions were redundant with conditions already enforced upstream and have been removed. Two source call sites and two test call sites updated. -
checkFetwfeInputs()(R/fetwfe_core.R) no longer accepts the unusednlambdaargument. Three call sites updated.nlambdaitself remains unchanged on the public entry points (fetwfe(),betwfe(),twfeCovs()) where it is forwarded togBridge. -
getFirstInds()(R/utility.R) no longer runs a block of assertions that re-derived its own closed-form formula and compared the result to itself. The first three assertions on the cardinality off_indsare preserved. - Renamed the internal helper
prep_for_etwfe_regresiontoprep_for_etwfe_regression(typo correction). The function is@noRd, not exported, so the rename is internal.
Version 1.9.6 (2026-05-16)
-
R/utility.R::idCohorts()now reports every malformed unit at once rather than stopping on the first. Previously a user with multiple malformed units had to fix one, re-run, hit the next stop, fix again, re-run — one error round-trip per bad unit. After this change, both the balance check (every unit must appear in exactly T periods) and the absorbing-state check (treatment, once 1, must stay 1) collect violations across the entire unit loop and produce a single grouped error message with all offending units listed alphabetically (lexicographically; the unit name column is required to be character). Listings over 20 entries per bucket are truncated with a trailing summary count. The error message wording starts with the canonical prefixes “Panel does not appear to be balanced” and “Treatment does not appear to be an absorbing state” so downstream grep-based consumers still match. The cohort-level stops atR/utility.R:191-195(“all units treated in the first period”) and:211-214are end-of-loop validation, not per-unit, and remain unchanged. Resolves GitHub #64. This was item 5 of #56, deferred from v1.9.5 because it changes user-visible error wording.
Version 1.9.5 (2026-05-16)
- Small consistency cleanups surfaced by an internal code review; bundled as one PR. None of these fire under current package usage, but each is wrong on inspection and would bite a future refactor of the surrounding machinery. Resolves GitHub #56.
- (Item 1)
R/event_study.R::.assemble_event_study_df()now calls the canonical.compute_p_values()helper (R/utility.R:508) rather than re-implementing the p-value computation inline. The previous inline form usedis.na(ses) | ses == 0to mask NA / zero SEs; the canonical helper additionally masks negative SEs. The package’s own SE machinery never produces negative SEs (everything comes out ofsqrt(...)), so on every code path users currently exercise the output is bit-identical. The change is a defensive alignment against future refactors of the SE machinery. - (Item 2)
R/fetwfe_core.R::getSecondVarTermDataApp()line 2022 relaxesstopifnot(length(sel_inds[[r]]) < length(sel_inds[[r-1]]))to<=, matching the OLS analog atR/ols_calcs.R:449. Both assertions guard the same invariant; under the package’s standard cohort layout (first_inds = getFirstInds(R, T)) block sizes are strictly decreasing and both forms pass. Behavior unchanged on current usage; the relaxation is a no-op except for any future non-standard cohort layout. - (Item 3)
R/ols_calcs.R::getSecondVarTermOLS()line 465 changes theSigma_pi_hat-degeneracy threshold literal from10e-6(= 1e-5) to1e-6. The previous literal reads naturally as1e-6to an R reader who hasn’t done the arithmetic; the change aligns the typed literal with that reading. The assertion isstopifnot(sum(cohort_probs_overall) < 1 - eps)and the change loosens the rejection band from width1e-5to width1e-6. The relaxed band is still well above floating-point precision, and the guard is unreachable in normal operation: underallow_no_never_treated = TRUE(default) the panel is auto-truncated sosum(cohort_probs_overall) <= (N-1)/N, with margin>= 1/NforN >= 50. The symmetric guard (stopifnot(length(cohort_probs_overall) == R)andstopifnot(sum(cohort_probs_overall) < 1 - 1e-6)) is added to the FETWFE analogR/fetwfe_core.R::getSecondVarTermDataApp(), which previously had no such guard. - (Item 4)
R/utility.R::idCohorts()panel-balancestop()message now has balanced parentheses. The previous message read"Panel does not appear to be balanced (unit X does not have exactly T observations for T = 3"— the open parenthesis after “balanced” was never closed. Cosmetic. - One additional item from the same review —
idCohorts()collects all malformed units rather than stopping on the first — is deferred to a follow-up because it changes user-visible error wording in a way that deserves its own framing.
Version 1.9.4 (2026-05-16)
- Fixed a latent bug in
augment.fetwfe()/augment.etwfe()/augment.betwfe()(R/broom_methods.R::.augment_estimator_output()): when a user passed an un-trimmed panel that contained first-period- treated units (so the augment auto-trim path fired), the returned data frame silently dropped thetreatmentcolumn. This was caused by augment assigningdata <- ret$dffromidCohorts(), which stripstreat_varfrom its output (R/utility.R:149). The no-trim path (pre-trimmed input wherenrow(data) == nrow(X_ints)) was unaffected — it preserved every user column. The fix keeps the unit-level filtering thatidCohorts()performs but identifies the surviving units fromidCohorts()’s output and filters the user’s originaldatadirectly, so the auto-trim path now preserves thetreatmentcolumn and any other extra columns the user supplied (e.g., state names, panel IDs) — matching the no-trim path. Point estimates, standard errors, and the no-trim path are unchanged. Resolves GitHub #51.
Version 1.9.3 (2026-05-16)
- Fixed a latent bug in two internal helpers —
.truncate_catt()(R/class_helpers.R) and.tidy_estimator_output()(R/broom_methods.R) — both of which sortedcatt_dfrows viaorder(catt_df$Cohort). TheCohortcolumn is character, so R’s defaultorder()sorted lexicographically:"10"and"11"came before"2"and"3". Two visible consequences on panels with ≥ 10 unique cohort adoption times: (a)tidy.<class>()row order was alphabetical rather than chronological; (b)print.<class>()andsummary.<class>()(which call.truncate_catt()withmax_cohorts) silently dropped the wrong cohorts — the earliest ones, treated as “later” alphabetically. Both helpers now use a composite keyorder(suppressWarnings(as.numeric(.)), .)that sorts numerically with a character tiebreak. Behavior on panels with ≤ 9 cohorts (every existing test fixture) is bit-identical to pre-fix. Resolves GitHub #53.
Version 1.9.2 (2026-05-16)
- Fixed a bug in
betwfe()’s standard-error calculation under partial selection. The internalgetPsiRUnfused()helper was normalizing the weight vectorpsi_rbyk_sel(the count of selected coefficients in a cohort’s treatment block) rather thank_full(the full block size). The cohort point estimatecohort_tes[r] = mean(tes[first_ind_r:last_ind_r])averages over the full block (unselected entries are exact zeros post-bridge), so the variance formula’spsi_rweighting targeted the wrong estimand whenever the bridge solver zeroed out some-but-not-all of a cohort’s coefficients. The bug violated BETWFE’s documented “asymptotically exact, non-conservative” SE promise. Effect on user-visible output: on panels with partial selection,betwfe()’s reportedcatt_df$SE,catt_df$ConfIntLow,catt_df$ConfIntHigh, andcatt_df$P_valueshift — per-cohort SEs shrink by factork_full / k_sel. The overallatt_sedirection is counterintuitive: it can grow, because the corrected per-cohort CATT vector is more dispersed across cohorts than the pre-fix mean-over-selected-only version, and theatt_var_2component is a quadratic form in cohort dispersion. Empirical magnitudes are ~2× shifts in either direction on representative partial-selection panels. Point estimates (att_hat,catt_df$Estimated TE) are unaffected. FETWFE, ETWFE, andtwfeCovs()are unaffected (FETWFE uses a differentpsi_rconstructor; ETWFE and twfeCovs never partial-select). Users withse_type = "cluster"also see SEs shift on partial-selection BETWFE fits (the cluster-robust path uses the samepsi_rweighting).
Version 1.9.1 (2026-05-15)
-
Fixed two coupled bugs in the internal variance-component estimator
estOmegaSqrtInv()(R/core_funcs.R). The previous implementation used the within-estimator procedure of Pesaran (2015, §26.5.1) with: (a) a wrong-LHS in the alpha-hat residual formula that collapsed it to a constant across units, and (b) a copy-on-modify trap in the in-place X-demeaning loop that leftglmnetfitting on un-demeaned X. Combined, these causedsig_eps_c_sq_hatto return as essentially zero (~1e-32) regardless of truth, which degenerated the GLS weighting step to the identity. Model-based standard errors forfetwfe()/etwfe()/betwfe()therefore treated clustered errors as i.i.d. whenever the user did not pre-supplysig_eps_c_sq. The estimator has been replaced by REML on the linear mixed-effects modely ~ X + (1 | unit)vialme4::lmer(Bates, Maechler, Bolker, & Walker 2015; Patterson & Thompson 1971; Pinheiro & Bates 2000). REML is the standard procedure for variance components in random-intercept models, handles FETWFE’s design (with its time-invariant columns) natively, and aligns the implementation with the random-effects GLS framework the paper assumes.lme4has been added toSuggests:(notImports:) and is gated byrequireNamespace("lme4", quietly = TRUE). When the package is not installed and the user has not suppliedsig_eps_sq/sig_eps_c_sqdirectly,fetwfe()(and siblings) error with a clear message pointing atinstall.packages("lme4")or supplying the variance components manually.User-visible impact: both standard errors and point estimates will shift after upgrade. Reported SE values for
fetwfe()/etwfe()/betwfe()will be larger on panels with substantial unit-level variance, reflecting clustered noise rather than i.i.d. noise. Point estimates will also shift, because the GLS weighting step — which was effectively a no-op under the bug — now actually re-weights the design matrix before the bridge regression. On the package’s flagship divorce-data example (vignettes/vignette.Rmd), the overall ATT changes from ~-1.84% to 0.00% with every cohort selected out under the corrected estimator (the previous value was an artifact of the bug preserving cohort 1970’s between-unit jump that should have been absorbed by the random intercept). The vignette has been updated accordingly. The paper’s empirical section will be updated in a forthcoming revision to the arXiv preprint.Users who supplied
sig_eps_sqandsig_eps_c_sqmanually are unaffected. Users usingse_type = "cluster"get unchanged cluster-robust SEs (the cluster path doesn’t depend onestOmegaSqrtInv), but their point estimates still shift since the GLS-transformed regression is shared across SE methods.Resolves the bug surfaced in the May 2026 internal code review.
Version 1.9.0 (2026-05-15)
- Added broom-package S3 methods
tidy()/glance()/augment()forfetwfe()/etwfe()/betwfe()outputs, plustidy()for the outputs ofeventStudy()andgetTes(), so users can pipe estimator output directly intoggplot2/modelsummary/gtworkflows without reading the package class documentation.tidy()returns a long data frame with broom-standard columns (term,estimate,std.error,statistic,p.value,conf.low,conf.high; plusselectedforfetwfe/betwfe), one row for the overall ATT and one per cohort.glance()returns a one-row model-level summary (13 columns forfetwfe/betwfe, 11 foretwfewithout thelambda_star*columns).augment(x, data)appends.fittedand.residto the user-supplied panel and auto-trims first-period- treated units (the same drop the estimator applies internally during fitting), so the call works with either the originalpdatapassed to the estimator or a pre-trimmed panel.tidy.eventStudy()acceptsconf.int/conf.levelfor CI control. The estimator outputs gain six additive metadata slots —y_mean,response_col_name,time_var,unit_var,treatment,covs— populated at fit time and consumed byaugment()(and a futurepredict()) so users don’t have to re-pass any of them.getTes()output gains acohort_timesslot (the simulator’s adoption-time labels,2..(R+1)) sotidy.FETWFE_tes()labels cohorts the same waytidy.<estimator>()labels them on a fitted panel. Methods are registered via the generics package (added toImports:);broomjoinsSuggests:for the vignette demo. Resolves #27.
Version 1.8.0 (2026-05-13)
- Fixed an off-by-one index in the Jacobian construction inside the internal helper
getSecondVarTermDataApp(), which backs FETWFE’satt_var_2— the cohort-probability variance component of the overall ATT standard error. The corrected formula uses the inner- loop / column-index marginal cohort probability per paper Theorem 6.3 (paper_arxiv.tex:2577-2592). The same fix is applied to the parallel.event_study_var2_fetwfe()helper introduced in 1.7.0. The reportedatt_seforfetwfe()shifts numerically; the bug could either over- or under-estimateatt_var_2depending on the joint structure of cohort probabilities and per-cohort ATT magnitudes. Observed magnitudes: ~30% underestimate on small simulated panels with unequal cohorts (Test 2 of the new test file); ~13% overestimate on the divorce-data example in the main vignette (which hasR = 12cohorts with very unequal sizes); a few percent on near-uniform panels. The shift also propagates throughatt_p_value(computed fromatt_se) and through the event-study output (eventStudy()andplot.fetwfe()columnsse,ci_low,ci_high,p_value). Empirical Monte Carlo validation against multinomial resampling of cohort probabilities confirms the corrected formula matches the true asymptotic variance to within MC noise (under 1% at 10k draws). The bug was masked in prior simulation studies becausesimulateData()uses a uniform cohort-probability prior, and the buggy and correct formulas are algebraically identical when all marginal cohort probabilities are equal.etwfe(),betwfe(), andtwfeCovs()are unaffected (their parallelgetSecondVarTermOLS()did not have this bug). FETWFE cohort-level CATT SEs incatt_dfare unaffected (they use only the regression-coefficient variance, not the cohort- probability variance). Closes #46.
Version 1.7.0 (2026-05-13)
- Added an exported
eventStudy(x, alpha)function and S3 methodsplot.fetwfe(),plot.etwfe(),plot.betwfe()that compute and visualize pooled event-time treatment-effect estimates with confidence intervals. Pooling weights are sample-cohort-size weights (matchingdid::aggte(type = "dynamic")convention); the variance combines a regression-coefficient term and a cohort-probability term, dispatching onse_typefor the regression term (model-based under default, cluster-robust sandwich underse_type = "cluster") and onindep_countsfor the conservative-vs-asymptotically-exact combination. Only post-treatment event times (e >= 0) are surfaced in this initial release. - Added
ggplot2toSuggests:(used by the newplot.*methods viarequireNamespace()guards; the package still installs and the estimators still run withoutggplot2). - Added the slot
cohort_probs_overall(length-Rnumeric vector of marginal cohort probabilities, using the indep-sample variant whenindep_countswas provided, else the in-sample variant) to the S3 outputs offetwfe(),etwfe(),betwfe()and the list output oftwfeCovs(). Also addedindep_counts_used(logical scalar) to the same four outputs. Thefetwfe()S3 output additionally gainstheta_hatin$internal(the full fused-coordinate coefficient vector with intercept). These slots are required by the neweventStudy()machinery and are useful for downstream tooling.
Version 1.6.1 (2026-05-12)
- Added a no-covariate side-by-side demonstration of
etwfe()andfetwfe()tovignettes/etwfe_betwfe_vignette.Rmd. The main vignettevignettes/vignette.Rmdnow points readers at that section near the divorce-data application. An explicitcovs = c()end-to-end test of the publicfetwfe()entry point was added totests/testthat/test-fetwfe.R. The package already supported the no-covariate case (the simulator’sd = 0path is exercised bytests/testthat/test-genCoefs.Randtests/testthat/test-simulateData.R); this release closes the showcase gap.
Version 1.6.0 (2026-05-12)
- Added an experimental
se_type = c("default", "cluster")argument tofetwfe(),betwfe(),etwfe(),twfeCovs()and their*WithSimulatedData()wrappers. Settingse_type = "cluster"replaces the package’s Assumption-F1-based standard errors with a unit-clustered Liang-Zeger sandwich on the bridge-selected support (for FETWFE/BETWFE) or the OLS-selected support (for ETWFE/twfeCovs); bothatt_seandcatt_ses(and the derived confidence intervals and p-values) are recomputed from this sandwich. For FETWFE/BETWFE,se_type = "cluster"is meaningful only whenq < 1(the bridge oracle property is required); forq >= 1the SE remainsNAas before. The new option is experimental and the underlying theory is pending; see the companion vignetteinference_vignettefor the formula, the assumptions it relaxes from F1, and the theory-pending caveat. Default is"default", so existing callers see no behavior change. Theprint()andsummary()methods now label the SE line “Std. Error (cluster-robust)” / “SE (cluster-robust)” whense_type = "cluster"was used.
Version 1.5.6 (2026-05-11)
- The four estimators (
fetwfe(),betwfe(),etwfe(),twfeCovs()) and their*WithSimulatedData()wrappers now accept a newallow_no_never_treated = TRUEargument. When the input panel has zero never-treated units (previously a hard error), the package auto-truncates the panel by dropping time periods at and after the latest cohort’s start time — the units in that latest cohort then serve as the never-treated comparison group in the retained sub-panel — and issues a clear warning naming the dropped periods. Passallow_no_never_treated = FALSEto restore the previous hard-error behavior. The argument has no effect when the input already contains never-treated units.
Version 1.5.5 (2026-05-11)
-
fetwfe(),betwfe(),etwfe(), andtwfeCovs()now surface a per-cohortP_valuecolumn incatt_dfand a top-levelatt_p_valuefield on the returned list. Forfetwfe()andbetwfe()(which perform bridge regression with selection), thecatt_dfalso gains aselectedlogical column and the return list gains a top-levelatt_selectedfield; selected-out cohorts haveP_value = NAandselected = FALSE. The previously documented but non-functionalorder_by = "pvalue"option in the S3print()methods now works as advertised. See the new “Testing the zero-effect null” section in the package vignette for interpretation guidance under FETWFE’s restriction selection consistency.
Version 1.5.4 (2026-05-10)
- Added a new vignette
vignettes/etwfe_betwfe_vignette.Rmd(“Comparison Estimators: ETWFE and BETWFE”) demonstratingetwfe()andbetwfe()on simulated panel data (with comparison to true treatment effects viagetTes()), plus practical guidance on when to use each estimator vs. the recommendedfetwfe(). Resolves #17. - Output of
betwfe()is now an S3 object of classbetwfewithprint(),summary(), andcoef()methods, matching the pattern already in place forfetwfe()andetwfe(). Existing field accessors ($att_hat,$att_se,$catt_df, etc.) are unchanged.
Version 1.5.3 (2026-05-10)
- Resolved 11 “Could not resolve link to topic” warnings from
devtools::document()againstR/fetwfe_core.RandR/etwfe_core.Rby replacing internal-helper Markdown link forms[func()]with\code{func()}, plus one LaTeX-in-@returnfix to use\eqn{}instead of\(...\). Internal cleanup; no behavior change. Resolves #21.
Version 1.5.2 (2026-05-10)
- Fixed two redirected URLs in the main vignette (
vignettes/vignette.Rmd) that pointed at a bookdown.org domain now 301-redirecting to Posit Connect cloud. Resolves #20.
Version 1.5.0 (2025-07-01)
CRAN release: 2025-07-02
- Updates to documentation, various minor tweaks to prepare for CRAN submission.
Version 1.4.1 (2025-06-06)
- Add argument
guarantee_rank_conditiontosimulateData()to provide option to ensure that final design matrix has full column rank.
Version 1.4.0 (2025-06-06)
- Add S3 class for
fetwfe().
Version 1.3.0 (2025-05-25)
- Add functions:
-
twfeCovs()(implementation of two-way fixed effects with covariates) -
twfeCovsWithSimulatedData()(analogous tofetwfeWithSimulatedData())
-
Version 1.2.0 (2025-05-24)
- Add functions:
-
btwfe()(implementation of bridge-penalized extended two-way fixed effects) -
btwfeWithSimulatedData()(analogous tofetwfeWithSimulatedData())
-
Version 1.1.0 (2025-05-23)
- Add functions:
-
etwfe()(implementation of extended two-way fixed effects) -
etwfeWithSimulatedData()(analogous tofetwfeWithSimulatedData()) -
attgtToFetwfeDf()(converts data.frame formatted fordid::att_gt()to format required forfetwfe()andfewtfe::etwfe() -
ewtfeToFetwfeDf()(converts data.frame formatted foretwfe::etwfe()to format required forfetwfe()andfetwfe::etwfe()
-
Version 0.10.1 (2025-03-08)
- Add support for factor covariates in
fetwfe().
Version 0.10.0 (2025-03-04)
- Add back in functions
genCoefsCore()andsimulateDataCore()for export, and add tests for them. (Though these more flexible functions are now available, emphasis for end users will still be on using wrapper functionsgenCoefs()andsimulateData().)
Version 0.9.0 (2025-03-04)
- Changed implementation of
genCoefs()to a wrapper function that creates an object that can be piped intosimulateData(), itself a new wrapper function for the function that was previously calledgenRandomData(). The output ofsimulateData()can then be piped into another new wrapper function,fetwfeWithSimulatedData().
Version 0.8.0 (2025-03-02)
- Added argument
add_ridgetofetwfe(), which adds a ridge regularization term to the (untransformed) coefficients in estimation, similarly to the elastic net.
Version 0.7.0 (2025-03-01)
- Added function
getTes()to get treatment effects from a vector of coefficients generated bygenCoefs()and/or estimated on data generated fromgenRandomData().
Version 0.6.0 (2025-02-28)
- Added functions
genRandomData(), for generating random panel data suitable forfetwfe(), andgenCoefs(), which generates a random vector of coefficients that is needed as an input togenRandomData().
Version 0.5.1 (2025-02-26)
- Slight updates to handle cases when only one column or row of matrix is selected more smoothly.
Version 0.4.4 (2025-02-20)
CRAN release: 2025-02-21
- Update DESCRIPTION to align with CRAN requirements.