lmfence {mplot} | R Documentation |
The fence procedure for linear models
Description
This function implements the fence procedure to find the best linear model.
Usage
lmfence(mf, cstar, nvmax, adaptive = TRUE, trace = TRUE, force.in = NULL, ...)
Arguments
mf |
an object of class |
cstar |
the boundary of the fence, typically found through bootstrapping. |
nvmax |
the maximum number of variables that will be be considered in the model. |
adaptive |
logical. If |
trace |
logical. If |
force.in |
the names of variables that should be forced into all estimated models. |
... |
further arguments (currently unused) |
References
Jiming Jiang, Thuan Nguyen, J. Sunil Rao, A simplified adaptive fence procedure, Statistics & Probability Letters, Volume 79, Issue 5, 1 March 2009, Pages 625-629, http://dx.doi.org/10.1016/j.spl.2008.10.014.
See Also
Examples
n = 40 # sample size
beta = c(1,2,3,0,0)
K=length(beta)
set.seed(198)
X = cbind(1,matrix(rnorm(n*(K-1)),ncol=K-1))
e = rnorm(n)
y = X%*%beta + e
dat = data.frame(y,X[,-1])
# Non-adaptive approach (not recommended)
lm1 = lm(y~.,data=dat)
lmfence(lm1,cstar=log(n),adaptive=FALSE)