Home > database >  Extract the optimal model based on BIC in R
Extract the optimal model based on BIC in R

Time:10-01

I use the following function in R to choose the model with smallest BIC

step(fit4, direction = "both", k=log(nrow(college_train)))

In my R markdown profile, every iteration and result appear, which is longer than 4 pages.

I have known that the last one is the model that I want.

Is there a function in R shows only the last model in my R markdown profile when I use step() function

CodePudding user response:

I'm not sure for R markdown but you may try

step(fit4, direction = "both", trace = 0, k=log(nrow(college_train)))
  • Related