I'm a relative novice with R so bear with me. I have a piece of code that calls the function fs. When I run it, I get this message: Error in fs(x, y) : could not find function "fs" I know the function is there because I installed it with library(fs). Can anyone give me some help or advice here?
library(fs)
set.seed(33)
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 forward stepwise, plot results
fsfit = fs(x,y)
plot(fsfit)
# compute sequential p-values and confidence intervals
# (sigma estimated from full model)
# out = fsInf(fsfit)
# out