
Last chance! 50% off unlimited learning
Sale ends in
This functions checks the input to the double_select function for compliance with the default methods used, confirming that the inputs are viable. It is a helper - no interaction with the user should happen unless the user explicitly calls this function.
input_checker(X_matrix, Y_vector, W_vector, specify.custom,
test.inputs = TRUE)
A matrix of covariates (must be all numeric)
A vector of the target variable, of same length as the number of rows of X, must be numeric
A vector of the treatment variable, of same length as the number of rows of X, must be numeric
disables input checking by default, and leaves it to the user.
If set to FALSE disables input checking, the default is TRUE.
A message indicating the status of input checking, or lack thereof.
The function will throw a warning if it is disabled ( the input is not checked) or stop the processing if the input is checked, but incorrect. Disables checking for custom functions by default.
# NOT RUN {
n = 2000; p = 10
X = matrix(rnorm(n*p), n, p)
W = rbinom(n, 1, 0.4 + 0.2 * (X[,1] > 0))
Y = pmax(X[,1], 0) * W + X[,2] + pmin(X[,3], 0) + rnorm(n)
input_checker(X_matrix = X, Y_vector = Y, W_vector = W,
specify.custom = NULL, test.inputs = TRUE)
# }
Run the code above in your browser using DataLab