vif {VIF}R Documentation

Fitting Linear Models using VIF-Regression

Description

vif selects variables for a linear model. It returns a subset of variables for building a linear model.

Usage

        vif(y, x, w0 = 0.05, dw = 0.05, subsize = 200, trace = TRUE, mode = c("dense", "sparse"))

Arguments

y the response.
x an optional data frame or matrix containing the variables in the model.
w0 the initial wealth.
dw the incremental wealth attained if a variable is included in the model.
subsize the size of the subsample to approximate the variance inflation factor.
trace logical. if TRUE a list containing current wealth, current test level, absolute t value and p-value for the current variable will be printed out.
mode "dense" or "sparse", specifying one of the two alpha-investings that should be used. Default is "sparse".

Value

A list containing:

select the chosen subset of variable.
modelmatrix the model matrix that is ready for fitting a linear model.

Author(s)

Dongyu Lin dongyu@wharton.upenn.edu

References

Lin, D., Foster, D.F. and Ungar, L.H. (2009) VIF-Regression: A Fast Regression Algorithm for Large Data. http://stat.wharton.upenn.edu/~dongyu/Papers/VIF.pdf

Examples


        data(syn);
        vif.sel <- vif(syn$y, syn$x, trace = FALSE);
        vif.sel$select;
        syn$true;
        
        data(housingexp);
        colnames(housingexp$x);
        vif.sel <- vif(housingexp$y, housingexp$x, w0 = 0.005, dw = 0.005, subsize = 300, trace = FALSE);


[Package VIF version 0.5 Index]