screen_cor | R Documentation |
Creates an object class 'screencoef'
using arguments passed by user,
where the screening coefficient should be computed based on the correlation
coefficient of response and each predictor separately.
screen_cor(..., control = list())
... |
includes arguments which can be passed as attributes to the
|
control |
list of controls to be passed to the screening function |
Creates an object class 'screencoef'
using arguments passed by user.
The function generate_fun
relies on cor.
Arguments related to the screening procedure can
be passed to the screen_cor()
function through ...
, and
will be saved as attributes of the 'screencoef'
object.
The following attributes are relevant for spar and spar.cv:
nscreen
integer giving the number of variables to be retained
after screening; if not specified, defaults to $2n$.
split_data_prop
, double between 0 and 1 which indicates the
proportion of the data that should be used for computing the screening
coefficient. The remaining data will be used for estimating the marginal
models in the SPAR algorithm; if not specified, the whole data will be used
for estimating the screening coefficient and the marginal models.
type
character - either "prob"
(indicating that
probabilistic screening should be employed) or "fixed"
(indicating
that a fixed set of nscreen
variables should be employed across the
ensemble); defaults to type = "prob"
.
reuse_in_rp
logical - indicates whether the screening
coefficient should be reused at a later stage in the construction of the random
projection. Defaults to FALSE
.
object of class 'screencoef'
which is a list with elements
name
(character)
control
(list of controls passed as an argument)
generate_fun
for generating the screening coefficient.
This function should have arguments and y
(vector of (standardized for Gaussian) responses),
x
(the matrix of standardized predictors) and a 'screencoef'
object.
example_data <- simulate_spareg_data(n = 200, p = 2000, ntest = 100)
spar_res <- spar(example_data$x, example_data$y, xval = example_data$xtest,
yval = example_data$ytest, nummods=c(5, 10, 15, 20, 25, 30),
screencoef = screen_cor(control = list(method = "kendall")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.