If Y is univariate, this function implements FS in regression. If Y is multivariate, this function implements FS using the F-test described by Miller and Farr (1971). This test requires that (i) the Y variables be standardized, and (ii) the error in the response variables be normally distributed (to be verified by the user).

forward.sel.par(
  Y,
  X,
  alpha = 0.05,
  K = nrow(X) - 1,
  R2thresh = 0.99,
  R2more = 0.001,
  adjR2thresh = 0.99,
  Yscale = FALSE,
  verbose = TRUE
)

Arguments

Y

Response data matrix with n rows and m columns containing quantitative variables

X

Explanatory data matrix with n rows and p columns containing quantitative variables

alpha

Significance level. Stop the forward selection procedure if the p-value of a variable is higher than alpha. The default is 0.05

K

Maximum number of variables to be selected. The default is one minus the number of rows

R2thresh

Stop the forward selection procedure if the R-square of the model exceeds the stated value. This parameter can vary from 0.001 to 1

R2more

Stop the forward selection procedure if the difference in model R-square with the previous step is lower than R2more. The default setting is 0.001

adjR2thresh

Stop the forward selection procedure if the adjusted R-square of the model exceeds the stated value. This parameter can take any value (positive or negative) smaller than 1

Yscale

Standardize the variables in table Y to variance 1. The default setting is FALSE. The setting is automatically changed to TRUE if Y contains more than one variable. This is a validity condition for the parametric test of significance (Miller and Farr 1971)

verbose

If 'TRUE' more diagnostics are printed. The default setting is TRUE

Value

A dataframe with:

variables

The names of the variables

order

The order of the selection of the variables

R2

The R2 of the variable selected

R2Cum

The cumulative R2 of the variables selected

AdjR2Cum

The cumulative adjusted R2 of the variables selected

F

The F statistic

pval

The P-value statistic

Details

The forward selection will stop when either K, R2tresh, adjR2tresh, alpha and R2more has its parameter reached.

References

Miller, J. K. & S. D. Farr. 1971. Bimultivariate redundancy: a comprehensive measure of interbattery relationship. Multivariate Behavioral Research, 6, 313–324.

Author

Pierre Legendre pierre.legendre@umontreal.ca and Guillaume Blanchet

Examples


x <- matrix(rnorm(30),10,3)
y <- matrix(rnorm(50),10,5)
    
forward.sel.par(y,x, alpha = 0.5)
#> The variables in response matrix Y have been standardized 
#> Procedure stopped (alpha criterion): pvalue for variable  2  is  1 
#> Procedure stopped (R2more criterion): delta for variable  2  is  -0.419663 
#>   variable order        R2     R2cum   AdjR2Cum        F      pval
#> 1       V1     1 0.1710138 0.1710138 0.06739051 1.650341 0.1690767
#> 2       V3     3 0.1453721 0.3163859 0.12106760 1.488566 0.2185444
#> 3       V2     2 0.1032770 0.4196630 0.12949444 1.067763 0.3976949