checkData: Subsidiary Function for Comparative Causal Mediation Analysis
Description
Subsidiary function to check correctness of data structure and return final data for analysis
Usage
checkData(Y,T1,T2,M,data = NULL)
Arguments
Y
numeric outcome variable. Should be a vector if a data frame is not provided through the data argument, or the ("character") name of the variable in the data frame if provided.
T1
binary indicator for first treatment. Should be a vector if a data frame is not provided through the data argument, or the ("character") name of the variable in the data frame if provided.
T2
binary indicator for second treatment. Should be a vector if a data frame is not provided through the data argument, or the ("character") name of the variable in the data frame if provided.
M
numeric mediator variable. Should be a vector if a data frame is not provided through the data argument, or the ("character") name of the variable in the data frame if provided.
data
an optional data frame containing the variables to be used in analysis.
Value
A data frame that contains the final data to be analyzed in the getCCM() function.
References
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.