potentialoutcome_facX {unvs.med} | R Documentation |
Estimation of Potential Outcomes Based on the Universal Approach (for factor 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_facX (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 in the following cases. (1) The exposure is already specified as a factor variable in advance. (2) The exposure is a character variable. (3) The exposure is a character variable which the user already specify it as a factor variable with certain factor levels.
Value
This function returns a value of the potential outcome.