lm_filter | R Documentation |
Linear models are fitted on each predictor, with inclusion of variable names
listed in force_vars
in the model. Predictors are ranked by Akaike
information criteria (AIC) value, or can be filtered by the p-value on the
estimate of the coefficient for that predictor in its model.
lm_filter( y, x, force_vars = NULL, nfilter = NULL, p_cutoff = NULL, rsq_cutoff = NULL, type = c("index", "names", "full") )
y |
Numeric or integer response vector |
x |
Matrix of predictors. If |
force_vars |
Vector of column names |
nfilter |
Number of predictors to return. If |
p_cutoff |
p-value cut-off. P-values are calculated by t-statistic on the estimated coefficient for the predictor being tested. |
rsq_cutoff |
r^2 cutoff for removing predictors due to collinearity.
Default |
type |
Type of vector returned. Default "index" returns indices, "names" returns predictor names, "full" returns a matrix of p values. |
Integer vector of indices of filtered parameters (type = "index"
)
or character vector of names (type = "names"
) of filtered parameters in
order of linear model AIC. Any variables in force_vars
which are
incorporated into all models are listed first. If type = "full"
a matrix
of AIC values, sigma, the residual standard error (see summary.lm),
t-statistic and p-values for the tested predictor is returned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.