We test whether x and y are conditionally associated, given
S using a generalized linear model.
psi_hat_sl(y, x, S=c(), subset = NULL, out_bin = TRUE, exp_bin = FALSE,
sl=NULL,cross_fitting = FALSE,kfolds=5)Outcome variable, either binary or numeric
Exposure variable, either binary or numeric
Conditional variable set, can be empty
Optionally, control the subset of the dataset to be used
A logical evaluating to TRUE or FALSE indicating whether outcome variable is binary.
A logical evaluating to TRUE or FALSE indicating whether exposure variable is binary.
Character string specifying models applied in super learning
A logical evaluating to TRUE or FALSE indicating whether cross-fitting is used.
A numeric indicating how many folds is used for cross-fitting if applied
Test statistics and standard error of the test.
All included variables should be either numeric or binary. If y is numeric, the default method
is linear regression model, mean response,MARS, random forest and XGBoost. If
y is binary, the default method is LDA, mean response,MARS, random forest
and XGBoost.
This model is tested whether x and y is independent conditional on
S. The final result is the test statistics and standard error.