Skip to contents

Predictions from synthdid object

Usage

# S3 method for class 'synthdid'
predict(
  object,
  newdata = NULL,
  type = c("counterfactual", "treated", "effect"),
  ...
)

Arguments

object

A synthdid object

newdata

Currently not supported (reserved for future use)

type

Type of prediction: "counterfactual" (default), "treated", or "effect"

...

Additional arguments (currently ignored)

Value

A matrix or vector of predictions

Examples

# \donttest{
data(california_prop99)
result <- synthdid(PacksPerCapita ~ treated,
  data = california_prop99,
  index = c("State", "Year")
)
# Counterfactual (what would have happened without treatment)
pred_counterfactual <- predict(result, type = "counterfactual")
# Observed treated outcomes
pred_treated <- predict(result, type = "treated")
# Treatment effect over time
pred_effect <- predict(result, type = "effect")
# }