Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


postDoubleR (version 1.4.12)

input_checker: Helper function for input checking

Description

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.

Usage

input_checker(X_matrix, Y_vector, W_vector, specify.custom,
  test.inputs = TRUE)

Arguments

X_matrix

A matrix of covariates (must be all numeric)

Y_vector

A vector of the target variable, of same length as the number of rows of X, must be numeric

W_vector

A vector of the treatment variable, of same length as the number of rows of X, must be numeric

specify.custom

disables input checking by default, and leaves it to the user.

test.inputs

If set to FALSE disables input checking, the default is TRUE.

Value

A message indicating the status of input checking, or lack thereof.

Details

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.

Examples

Run this code
# 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