Estimates the marginal effect of a one-unit increase in treatment intensity in the post period.
Usage
morie_did_continuous_treatment(
data,
outcome,
dose,
post,
covariates = NULL,
cluster = NULL,
alpha = 0.05
)Arguments
- data
A data frame containing the outcome, treatment, post and any covariate columns.
- outcome
Name of the outcome column.
- dose
Continuous treatment-intensity column.
- post
Name of the binary (0/1) post-period column.
- covariates
Optional character vector of covariate column names.
- cluster
Optional cluster ID column for CR1 standard errors.
- alpha
Significance level for confidence intervals (default 0.05).
Value
A result list; see morie_did_2x2.
Examples
set.seed(1)
n <- 300
dose <- runif(n, 0, 3)
p <- rbinom(n, 1, 0.5)
y <- 0.4 * dose * p + rnorm(n, sd = 0.5)
df <- data.frame(y = y, dose = dose, post = p)
res <- morie_did_continuous_treatment(df, "y", "dose", "post")
res$estimate
#> [1] 0.4231749
