Learn R Programming

matie (version 1.0)

fbvs: Forwards, backwards variable selection.

Description

Attempts to find the best explanatory set of variables to explain a single variable in a data set. Iterates between adding the next best variable to the set and removing the variable (if any) whose exclusion maximizes the overall score.

Usage

fbvs(dataSet,one,maxv,linear)

Arguments

Value

Returns a list containing the following items:onethe name of the one variable that requires the explanatory setbestthe best set of explanatory variablesRsqan estimate for R^2 provided by the best set of explanatory variables

Details

Variable names are only added to the explanatory set if their inclusion results in an increase in the association measure.

References

coming soon

See Also

ma agram

Examples

Run this code
# measure association for all pairs in a subrange of the baseball dataset
    data(baseballData)
    fbvs(baseballData,one="Salary")
    fbvs(baseballData,one="Salary",linear=TRUE)

    fbvs(baseballData,one="Salary",maxv=2)
    fbvs(baseballData,one="Salary",maxv=2,linear=TRUE)

Run the code above in your browser using DataLab