Alex
Alex

Reputation: 353

Extract the optimal model based on BIC in R

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

Upvotes: 1

Views: 288

Answers (1)

Kra.P
Kra.P

Reputation: 15123

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

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

Upvotes: 2

Related Questions