summary.unvs.med: Summary of Formal Estimation for Causal Mediation Effects

summary.unvs.medR Documentation

Summary of Formal Estimation for Causal Mediation Effects

Description

This function presents the refined statistics results of the mediation effects on risk difference (RD), odds ratio (OR) and risk difference (RR) scales from function FormalEstmed. This function is applied on the resulting object of class "unvs.med" from function FormalEstmed. The output shows the mean, standard error, t-statistics, p-value and confident interval of the effect estimates based on bootstrapping estimations.

Usage

## S3 method for class 'unvs.med'
 summary(object, form = "short", scale = "RD", ...)

Arguments

object

a resulting object of class 'unvs.med' from function FormalEstmed.

form

a character variable indicating the output form. It can be "short" or "long". The default is "short".

scale

a character variable of the effect scales. It can be "RD", "OR" or "RR". If scale equals to string "all", "ALL" or "All", then effects on three scales will be displayed. The default is "RD".

...

additional parameters passed to "summary".

In addition, The function identifies it as the same string if the first letter is capital or all letters are capital. For example, "short" equals to "Short" and "SHORT".

Value

No return value, called for displaying the output of the estimation result.

Examples


# Running formal estimation
data(testdata)
med_model=glm(med~exp+C1+C2+C3, data=testdata, family=binomial) # Fitting mediator's model
out_model=lm(out~med*exp+C1+C2+C3, data=testdata) # Fitting outcome's model
r1 = FormalEstmed (med_model=med_model, out_model=out_model,
data=testdata, exposure = "exp") # Running formal estimation via bootstrapping

# Summary examples
summary(r1) # Summary of the default settings (Short form and on RD scales).
summary(r1, "long") # Summary of long form and on RD scales.
summary(r1, "long", "OR") # Summary of long form and on OR scales.
summary(r1, "long", "RR") # Summary of long form and on RR scales.
summary(r1, "long", "all") # Summary of long form and on all scales.
summary(r1, form="short", scale="all") # Summary of short form and on all scales.



unvs.med documentation built on June 8, 2025, 10:15 a.m.