SingleEstimation: Single-time Estimation for Causal Mediation Effects

View source: R/SingleEstimation.R

SingleEstimationR Documentation

Single-time Estimation for Causal Mediation Effects

Description

This function obtains the estimates of various types of mediation effects for a single time based on one bootstrap sample. This function calculates the effects through different combinations of potential outcomes by the algorithm we proposed.

This is an internal function, automatically called by the function BootEstimation_for or BootEstimation_MT.

Usage

SingleEstimation (m_model, y_model, data, X, M, Y, m_type, y_type)

Arguments

m_model

a fitted model object for the mediator.

y_model

a fitted model object for the outcome.

data

a dataframe used in the analysis.

X

a character variable of the exposure's name.

M

a character variable of the mediator's name.

Y

a character variable of the outcome's name.

m_type

a character variable of the mediator's type.

y_type

a character variable of the outcome's type.

Value

This function returns a list of three dataframes of mediation effects on risk difference (RD), odds ratio (OR) and risk ratio (RR) scales. Each dataframe has only one single estimate for each effect.


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