# NOT RUN {
set.seed(43)
n = 50
p = 10
sigma = 1
x = matrix(rnorm(n*p),n,p)
beta = c(3,2,rep(0,p-2))
y = x%*%beta + sigma*rnorm(n)
# run LAR, plot results
larfit = lar(x,y)
plot(larfit)
# }
Run the code above in your browser using DataCamp Workspace