Extract point estimates evaluated at a0
, a1
, m_cde
, and c_cond
.
# S3 method for regmedint
coef(object, a0 = NULL, a1 = NULL, m_cde = NULL, c_cond = NULL, ...)
An object of the regmedint
class.
A numeric vector of length 1
A numeric vector of length 1
A numeric vector of length 1 The mediator value at which the controlled direct effect (CDE) conditional on the adjustment covariates is evaluated. If not provided, the default value supplied to the call to regmedint
will be used. Only the CDE is affected.
A numeric vector of the same length as cvar
. A set of covariate values at which the conditional natural effects are evaluated.
For compatibility with the generic. Ignored.
A numeric vector of point estimates.
library(regmedint)
data(vv2015)
regmedint_obj <- regmedint(data = vv2015,
## Variables
yvar = "y",
avar = "x",
mvar = "m",
cvar = c("c"),
eventvar = "event",
## Values at which effects are evaluated
a0 = 0,
a1 = 1,
m_cde = 1,
c_cond = 0.5,
## Model types
mreg = "logistic",
yreg = "survAFT_weibull",
## Additional specification
interaction = TRUE,
casecontrol = FALSE)
coef(regmedint_obj)
#> cde pnde tnie tnde pnie te
#> 0.541070807 0.488930417 0.018240025 0.498503455 0.008666987 0.507170442
#> pm
#> 0.045436278
#> attr(,"args")
#> attr(,"args")$a0
#> [1] 0
#>
#> attr(,"args")$a1
#> [1] 1
#>
#> attr(,"args")$m_cde
#> [1] 1
#>
#> attr(,"args")$c_cond
#> [1] 0.5
#>
## Evaluate at different values
coef(regmedint_obj, m_cde = 0, c_cond = 1)
#> cde pnde tnie tnde pnie te
#> 0.440756562 0.492306223 0.018077074 0.501765186 0.008618111 0.510383297
#> pm
#> 0.044816400
#> attr(,"args")
#> attr(,"args")$a0
#> [1] 0
#>
#> attr(,"args")$a1
#> [1] 1
#>
#> attr(,"args")$m_cde
#> [1] 0
#>
#> attr(,"args")$c_cond
#> [1] 1
#>