View source: R/sensmediation.R
more.effects | R Documentation |
"effectsMed"
objectTakes an "effectsMed"
object and estimates additional natural direct and indirect effects, with a sensitivity analysis using
the same sensitivity parameter as in the original analysis, without having to redo the optimization to find the estimated regression coefficients.
The effects to be estimated are regulated through the arguments covariates
, alt.decomposition
, exp.value
and control.value
as described in the documentation for sensmediation
. The confidence level used is regulated through the argument conf.level
.
more.effects(
sensmed.object,
conf.level = 0.95,
covariates = NULL,
alt.decomposition = FALSE,
exp.value = NULL,
control.value = NULL
)
sensmed.object |
an object of class "effectsMed" for which additional effects are to be calculated. |
conf.level |
the confidence level to be used for confidence intervals and uncertainty intervals. |
covariates |
if conditional effects are to be estimated the list of covariate values (see |
alt.decomposition |
logical indicating whether alternative definitions of the direct and indirect effects should be used (see |
exp.value |
value of the exposure variable used as the exposure condition, default is to take the value stored in |
control.value |
value of the exposure variable used as the control (unexposed) condition, default is to take the value stored in |
more.effects
returns an object of class "effectsMed"
, see the documentation for sensmediation
for information.
Anita Lindmark
sensmediation
## Not run:
# Example with data from Riksstroke (the Swedish stroke register)
data(RSdata)
# Probit mediator and outcome models:
med.model <- glm(lowered.consc ~ AF + age.cat + sex, data = RSdata,
family = binomial(link = 'probit'))
out.model <- glm(cf.3mo ~ AF + lowered.consc + age.cat + sex, data = RSdata,
family = binomial(link = 'probit'))
# First we estimate marginal NIE, NDE with sensitivity analyses to mediator-outcome
# confounding:
sensmed <- sensmediation(med.model, out.model, exp.name = "AF1", med.name = "lowered.consc",
Rho = seq(0, 0.5, 0.1))
# Then we also estimate NIE, NDE conditional on male sex without reestimating the regression
# coefficients:
sensmed.cond <- more.effects(sensmed.object = sensmed, covariates = list(sex = 1))
summary(sensmed.cond)
plot(sensmed.cond)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.