screen.wgtd.ttest | R Documentation |
Performs feature selection according to the ranking of t statistics
or P-values returned from weighted t-tests. Implemented via
wtd.t.test
.
screen.wgtd.ttest(
Y,
X,
family,
obsWeights,
id,
selector = c("cutoff.k", "cutoff.k.percent"),
k = switch(selector, cutoff.k = ceiling(0.5 * ncol(X)), cutoff.k.percent = 0.5, NULL),
minP = NULL,
...
)
Y |
Outcome (numeric vector). See |
X |
Predictor variable(s) (data.frame or matrix). See
|
family |
Error distribution to be used in the model:
|
obsWeights |
Optional numeric vector of observation weights. See
|
id |
Cluster identification variable. Currently unused. |
selector |
A string corresponding to a subset selecting function
implemented in the FSelector package. One of:
|
k |
Numeric. Minimum number or proportion of features to select.
Passed through to the |
minP |
Numeric. To pass the screen, resulting P-values must not exceed this
number. Ignored if |
... |
Passed to |
A logical vector with length equal to ncol(X)
# based on example in SuperLearner package
set.seed(1)
n <- 100
p <- 20
X <- matrix(rnorm(n*p), nrow = n, ncol = p)
X <- data.frame(X)
Y <- rbinom(n, 1, plogis(.2*X[, 1] + .1*X[, 2] - .2*X[, 3] + .1*X[, 3]*X[, 4] - .2*abs(X[, 4])))
obsWeights <- 1/runif(n)
screen.wgtd.ttest(Y, X, binomial(), obsWeights, seq(n), k = 4)
screen.wgtd.ttest4 <- function(..., k = 4){
screen.wgtd.ttest(..., k = k)
}
library(SuperLearner)
sl = SuperLearner(Y, X, family = binomial(), cvControl = list(V = 2),
obsWeights = obsWeights,
SL.library = list(c("SL.lm", "All"),
c("SL.lm", "screen.wgtd.ttest4")))
sl
sl$whichScreen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.