checkData {ccmEstimator} | R Documentation |
Subsidiary function to check correctness of data structure and return final data for analysis
checkData(Y,T1,T2,M,data = NULL)
Y |
numeric outcome variable. Should be a vector if a data frame is not provided through the |
T1 |
binary indicator for first treatment. Should be a vector if a data frame is not provided through the |
T2 |
binary indicator for second treatment. Should be a vector if a data frame is not provided through the |
M |
numeric mediator variable. Should be a vector if a data frame is not provided through the |
data |
an optional data frame containing the variables to be used in analysis. |
A data frame that contains the final data to be analyzed in the getCCM()
function.
This function is called internally but may be used directly to recover final data set that can be used for analysis in the getCCM()
function.
Kirk Bansak and Xiaohan Wu
Bansak, K. (2020). Comparative causal mediation and relaxing the assumption of no mediator-outcome confounding: An application to international law and audience costs. Political Analysis, 28(2), 222-243.
data(ICAapp)
final.dat <- checkData(Y = "dapprp", T1 = "trt1", T2 = "trt2", M = "immorp", data = ICAapp)