checkData {ccmEstimator}R Documentation

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.

Note

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.

Author(s)

Kirk Bansak and Xiaohan Wu

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.

Examples

data(ICAapp)
final.dat <- checkData(Y = "dapprp", T1 = "trt1", T2 = "trt2", M = "immorp", data = ICAapp)

[Package ccmEstimator version 1.0.0 Index]