Estimated counterfactual (untreated potential outcome) matrix
Source:R/counterfactual.R
counterfactual_matrix.RdReturns a method's estimate of the untreated potential outcome \(Y(0)\) as
an N x T matrix on the panel's unit/time grid. This gives every estimator a
common interface, so counterfactuals – and the unit-period prediction RMSE
built on them (panel_rmse() with metric = "prediction") – can be compared
on the same footing.
Arguments
- object
A fitted object: a
tropfit, acf_comparisonfrompanel_compare(), a synthdid estimate, or any object carrying acounterfactualelement.- ...
Unused; for method extensibility.
Value
For a single fit, an N x T numeric matrix (with NA where the
method does not define a counterfactual). For a cf_comparison, a named
list of such matrices, one per method.
Details
Coverage of the returned matrix differs by method. The native engines
(trop(), and the DID/MC/TROP fits inside panel_compare()) return a fitted
value for every cell. Methods whose model only defines a counterfactual for
the treated units – DIFP, and (when the optional package is installed) SDID,
SC and gsynth – fill the treated rows and leave control cells NA (a
control's untreated outcome is simply its observed value).
predict_counterfactual() is an alias for counterfactual_matrix().