summary.paths {paths} | R Documentation |
Summarizing Output from Causal Paths Analysis
Description
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.
Usage
## S3 method for class 'paths'
summary(object, ...)
## S3 method for class 'summary.paths'
print(x, ...)
Arguments
object |
an object of class |
... |
additional arguments to be passed to |
x |
an object of class |
Details
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.
Value
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
- nobs
number of observations in
data
- estimates
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.
See Also
paths
, print.paths
, plot.paths
Examples
# **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)