Description Usage Arguments Details Value See Also Examples
Function to report results from causal paths analysis. Report point estimates and standard errors for the total effect, direct effect, and each individual indirect effect, separately for Type I and Type II decompositions.
1 2 3 4 5 |
object |
an object of class |
... |
additional arguments to be passed to |
x |
an object of class |
print.summary.paths
tries to smartly format the point
estimates and confidence intervals, and provides 'significance stars'
through the printCoefmat
function.
It also prints out the names of the treatment, outcome, mediator variables as well
as pretreatment covariates, which are extracted from the formulas
argument of the
call to paths
so that users can verify if the model formulas have been
correctly specified.
An object of class summary.paths
, which is a list containing
the call
, varnames
, formulas
, classes
,
args
, ps_formula
, ps_class
, ps_args
,
nboot
, conf_level
components from the paths
object,
plus
number of observations in data
a
list containing four matrices, corresponding to effect estimates obtained
using the pure imputation estimator and the imputation-based weighting
estimator, each with Type I and Type II decompositions. Each matrix
contains the point estimates, standard errors, and confidence intervals of
the total effect, direct effect, and each individual indirect effect
for the corresponding decomposition. The elements in each matrix
are extracted from the paths
object.
paths
, print.paths
, plot.paths
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # **For illustration purposes a small number of bootstrap replicates are used**
data(tatar)
m1 <- c("trust_g1", "victim_g1", "fear_g1")
m2 <- c("trust_g2", "victim_g2", "fear_g2")
m3 <- c("trust_g3", "victim_g3", "fear_g3")
mediators <- list(m1, m2, m3)
formula_m0 <- annex ~ kulak + prosoviet_pre + religiosity_pre + land_pre +
orchard_pre + animals_pre + carriage_pre + otherprop_pre + violence
formula_m1 <- update(formula_m0, ~ . + trust_g1 + victim_g1 + fear_g1)
formula_m2 <- update(formula_m1, ~ . + trust_g2 + victim_g2 + fear_g2)
formula_m3 <- update(formula_m2, ~ . + trust_g3 + victim_g3 + fear_g3)
formula_ps <- violence ~ kulak + prosoviet_pre + religiosity_pre +
land_pre + orchard_pre + animals_pre + carriage_pre + otherprop_pre
####################################################
# Causal Paths Analysis using GLM
####################################################
# outcome models
glm_m0 <- glm(formula_m0, family = binomial("logit"), data = tatar)
glm_m1 <- glm(formula_m1, family = binomial("logit"), data = tatar)
glm_m2 <- glm(formula_m2, family = binomial("logit"), data = tatar)
glm_m3 <- glm(formula_m3, family = binomial("logit"), data = tatar)
glm_ymodels <- list(glm_m0, glm_m1, glm_m2, glm_m3)
# propensity score model
glm_ps <- glm(formula_ps, family = binomial("logit"), data = tatar)
# causal paths analysis using glm
# note: For illustration purposes only a small number of bootstrap replicates are used
paths_glm <- paths(a = "violence", y = "annex", m = mediators,
glm_ymodels, ps_model = glm_ps, data = tatar, nboot = 3)
# plot total, direct, and path-specific effects
summary(paths_glm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.