potentialoutcome_numX: Estimation of Potential Outcomes Based on the Universal...

View source: R/potentialoutcome_numX.R

potentialoutcome_numXR Documentation

Estimation of Potential Outcomes Based on the Universal Approach (for Numeric Exposure)

Description

This function realizes the main algorithm of the universal approach to estimate potential outcomes with observed data. Different potential outcomes can be estimated by different combinations of the input parameters xx and xm.

This is an internal function, automatically called by the function SingleEstimation.

Usage

potentialoutcome_numX (xx, xm, data, X, M, Y,
m_type, y_type, m_model, y_model)

Arguments

xx

a counterfactual value for exposure, directly affecting the outcome. Equals 1 in the treatment group, equals 0 in the control group.

xm

a counterfactual value for exposure, directly affecting the mediator. Equals 1 in the treatment group, equals 0 in the control group.

data

a dataframe used for the above models in the mediation 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.

m_model

a fitted model object for the mediator.

y_model

a fitted model object for the outcome.

Details

This function is called when the exposure is a numeric variable. Especially, a numeric exposure would be identified as a binary variable when it has only two values: 0 and 1. However, if the only two values are not 0 and 1, then users should specify it as a factor variable in advance so that function potentialoutcome_facX would be called automatically instead. The function still works well if the exposure is a multi-level discrete variable.

Value

This function returns a value of the potential outcome.


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