as_rct_spec | R Documentation |
StudySpecification
between typesConvert a StudySpecification
between a observational
study, a randomized control trial, and a regression discontinuity (created
from obs_spec
, rct_spec
and rd_spec
respectively).
as_rct_spec(StudySpecification, ..., loseforcing = FALSE)
as_obs_spec(StudySpecification, ..., loseforcing = FALSE)
as_rd_spec(StudySpecification, data, ..., forcing)
StudySpecification |
a |
... |
Ignored. |
loseforcing |
converting from RD to another |
data |
converting to an RD requires adding a |
forcing |
converting to an RD requires adding a |
StudySpecification
of the updated type
spec <- rct_spec(z ~ unit_of_assignment(uoa1, uoa2), data = simdata)
spec
as_obs_spec(spec)
as_rd_spec(spec, simdata, forcing = ~ . + forcing(force))
spec2 <- rd_spec(o ~ uoa(uoa1, uoa2) + forcing(force), data = simdata)
spec2
# as_rct_spec(spec2) # this will produce an error
as_rct_spec(spec2, loseforcing = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.