View source: R/potentialoutcome_numX.R
potentialoutcome_numX | R Documentation |
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
.
potentialoutcome_numX (xx, xm, data, X, M, Y,
m_type, y_type, m_model, y_model)
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. |
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.
This function returns a value of the potential outcome.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.