Changelog
Source:NEWS.md
contdid 0.1.3
- Sampling weights (
weightsname) now work (#14). Previously they were accepted with a warning but had no effect. They enter the dose regressions, the comparison-group means, the averages over the dose distribution, the aggregation across timing groups, and the influence functions behind the standard errors, for both the dose aggregation and the event studies.dose_est_method = "cck"does not support weights and now gives an error. - Bug fix:
ATT(d)andACRT(d)fromcont_did()withaggregation = "dose"were evaluated with a different B-spline basis than the one the dose regression was fitted with, unlessdvalsspanned exactly the range of the positive doses. With the defaultdvals(the 10% to 99% quantiles of the dose), the estimated dose-response curve was biased, most of all near the ends of the dose range. The basis now uses the range of the positive doses as its boundary knots everywhere (#16; thanks to @AsadGudzevic94). - Bug fix: with groups and time periods coded as calendar years, naming the group column
GgaveNaNestimates (ptetools #13).cont_did()now stores the dose as an internal column, so it never overwrites a user’s column, and selects each group-time subset using ptetools’ internal columns only. -
anticipationnow works:setup_pte_cont()did not pass it (orbase_periodandrequired_pre_periods) on toptetools::setup_pte(), so groups without a valid base period were kept and estimation failed.cont_two_by_two_subset()now builds each cell withptetools::two_by_two_subset(), so base periods, comparison groups and anticipation (in units of the time variable) followdid::att_gt(). - A timing group with no more treated units than parameters in the dose regression now gives a clear error naming the group, instead of “something off with overall influence function” or “non-conformable arguments” (ptetools #17).
-
control_groupandbase_periodare now used (#19, #10). They were not passed on to ptetools, socont_did()always used not-yet-treated comparison units and a varying base period, whatever was requested. With a universal base period, the outcome change is now computed between the base and current periods matched by unit, which also works when the base period comes after the current one (pre-treatment cells). -
clustervarsnow clusters standard errors (analytical and bootstrap) at a level above the unit, using ptetools’ new support (ptetools #6). It was previously ignored with a warning. It is not supported withdose_est_method = "cck". -
bstrap = FALSE(analytical standard errors) is now passed on to ptetools; it was ignored, so the multiplier bootstrap was always used. Analytical standard errors are not available for dose-specific effects, where the bootstrap is still used (with a warning). - Bug fix: standard errors of ACRT (overall and event study) were too small by a factor equal to the share of treated units in each group-time cell (#13). The ACRT influence function was on the scale of the treated units only; it is now rescaled to all units, as for
ATT(d). In simulations the reported SEs were about a third of the actual sampling variability before and match it now. Thanks to @AsadGudzevic94 (#17). -
cont_did()now works with its default choice arguments (target_parameter,aggregation,treatment_type,dose_est_method,control_group), which are resolved withmatch.arg(). Before, each had to be set explicitly or the call failed an argument check (#12). - The ACRT can now be estimated when no unit is untreated, e.g. when every unit is treated at the same time with different doses (#5). It only involves derivatives of the dose-response curve, so it is identified from variation in the dose within each timing group. With
target_parameter = "slope"and no untreated units,cont_did()now estimates it (with a message), for both aggregations and fordose_est_method = "cck". ATT(d) and the overall ATT are not identified without untreated units and are reported asNA; level parameters give a clear error when every unit is treated at the same time. - Fixed
dose_est_method = "cck"withcband = FALSE: the ACRT(d) critical value stayed at the uniform-band value instead of the pointwise one. -
control_group = "eventuallytreated"now works (ptetools #29): the comparison units are not-yet-treated units other than the never treated, and the latest-treated cohort serves only as a comparison group. It used to be silently treated as"nevertreated". - Repeated cross sections:
cont_did()gainspanel(defaultTRUE). Withpanel = FALSE, the level event study (target_parameter = "level",aggregation = "eventstudy") is supported, using ptetools’ repeated cross sections DiD estimator;idnameis then not needed. The dose-specific estimators (ATT(d), ACRT) still need panel data (#7). - Require
ptetools (>= 1.1.0), which fixes two problems with the standard errors ofATT(d):- The comparison-group part of the
ATT(d)influence function had the wrong sign, so withptetools1.0.1 the standard errors ofATT(d)were too small and its confidence bands undercovered. In simulations, coverage of nominal 95% intervals is now about 95%. - The standard errors of
ATT(d)andACRT(d)are now computed with the same B-spline basis as the estimates. With olderptetoolsthey would be too large near the ends of the dose range.
- The comparison-group part of the
contdid 0.1.2
CRAN release: 2026-10-30
- Bug fix:
cont_did()withtarget_parameter = "level"andaggregation = "eventstudy"passed the continuous dose, rather than a treated/comparison indicator, to the underlying DiD estimator. This made the estimator weight treated units by their dose and put weight on some treated units in the comparison group, so event-studyATTestimates from earlier versions were biased when treatment effects are nonzero. With DRDID >= 1.4.0, which now requires a binary treatment indicator, this case failed with an error instead. Other combinations oftarget_parameterandaggregationwere not affected.
contdid 0.1.1
CRAN release: 2026-07-21
- Resubmission to CRAN following archival on 2026-07-16 (contdid was archived because its dependency
ptetoolshad been archived;ptetoolshas since been restored to CRAN as version 1.0.1). - Require
ptetools (>= 1.0.1)inImportsto prevent recurrence. - Update
ggcont_did()to useptetools’sautoplot()methods in place of the now-deprecatedggpte()/ggpte_cont().