Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RegBest

Select variables in multiple linear regression


Description

Find an optimal submodel

Usage

RegBest(y,x, int = TRUE, wt=NULL, na.action = na.omit,
    method=c("r2","Cp", "adjr2"), nbest=1)

Arguments

y

A response vector

x

A matrix of predictors

int

Add an intercept to the model

wt

Optional weight vector

na.action

Handling missing values

method

Calculate R-squared, adjusted R-squared or Cp to select the model. By default a the F-test on the r-square is used

nbest

number of best models for each set of explained variables (by default 1)

Value

Returns the objects

all

gives all the nbest best models for a given number of variables

best

the best model

Author(s)

See Also

Examples

data(milk)
res = RegBest(y=milk[,6],x=milk[,-6])
res$best

FactoMineR

Multivariate Exploratory Data Analysis and Data Mining

v2.4
GPL (>= 2)
Authors
Francois Husson, Julie Josse, Sebastien Le, Jeremy Mazet
Initial release
2020-12-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.