Hey so I am developing a multiple regression model and using the forward subset selection method to reduce the number of parameters and using "mallows Cp" as a selection criterion. However this is an engineering problem and it does not make sense to have an intercept,, i.e. when all the predictors are zero, the prediction will be 0. Hence I want to remove the intercept from my regression equation. I know that in case of just regression a "lm(y~x+z-1)" will do , however this does not seem to work with my code.
#Fitting Using Model Selection
library(leaps)
a.fit<- regsubsets(ROP~.-1,data=dat1,nvmax=10)
summary(a.fit)
plot(summary(a.fit)$cp,xlab="No. of variables", ylab="Cp")
which.min((summary(a.fit)$cp))
plot(a.fit,scale="Cp")
coef(a.fit,6)
##Forward Stepwise Selection
f.fit<- regsubsets(ROP~.,data=dat1)
summary(f.fit)
plot(summary(f.fit)$cp,xlab="No. of variables", ylab="Cp")
which.min((summary(f.fit)$cp))
plot(f.fit,scale="Cp")
coef(f.fit,5)