# Why do I get different BIC values when I use regsubsets and lm in R

I used regsubsets to find a model with lowest BIC; height is our D.V. , the code I typed is below:

male = read.table(file.choose(), header=TRUE)
mreg = regsubsets(height ~ biacromial + pelvic.breadth + bitrochanteric + chest.depth
+ chest.diam + elbow.diam + wrist.diam + knee.diam + ankle.diam
+ shoulder.girth + chest.girth + waist.girth + navel.girth + hip.girth
+ thigh.girth + bicep.girth + forearm.girth + knee.girth + calf.girth
+ ankle.girth + wrist.girth + age + weight
, data=male)
plot(mreg)


so the best subset for male is: bitrochanteric,waist.girth+hip.girth+thigh.girth+bicep.girth, calf.girth+weight

I regress the model using lm

 mreg2 = lm(height ~ bitrochanteric + waist.girth + hip.girth + thigh.girth
+ bicep.girth + calf.girth + weight, data=male)
BIC(reg2)


Then I got a value of 1461.665 ,which is totally different from my graph and so I don't understand at all why it is different.

-

Just an investigation, I have never used this command before.

The vertical axis probably means "Drop in BIC" compared to the intercept-only model, not the model BIC.

For instance, if your ideal model has a BIC of 1451.665, corresponding to a drop of 220.

Then the model with just waist.girth and weight should have a BIC of about 1551. Because that model only has a drop of 120, which is still 100 higher than your ideal model.

Here is the track of my investigation:

library(leaps)
b<-regsubsets(Fertility~.,data=swiss,nbest=2)
summary(b)
plot(b)


Now compare the best and the worst models:

attach(swiss)
m01 <- glm(Fertility ~ Agriculture + Education + Catholic + Infant.Mortality)
m02 <- glm(Fertility ~ Examination)
m03 <- glm(Fertility ~ 1)
BIC(m01)
BIC(m02)
BIC(m03)
BIC(m02) - BIC(m03)  # Should be about -18
BIC(m01) - BIC(m03)  # Should be about -37
BIC(m02) - BIC(m01)  # Difference from the models
(-18) - (-37)        # Difference taken from the axis


Results:

>     BIC(m01)
[1] 336.3417
>     BIC(m02)
[1] 355.9029
>     BIC(m03)
[1] 377.4258
>     BIC(m02) - BIC(m03)  # Should be about -18
[1] -21.52281
>     BIC(m01) - BIC(m03)  # Should be about -37
[1] -41.08403
>     BIC(m02) - BIC(m01)  # Difference from the models
[1] 19.56122
>     (-18) - (-37)        # Difference taken from the axis
[1] 19

-
BIC can take more than one model like this > BIC(m01,m02,m03) df BIC m01 6 336.3417 m02 3 355.9029 m03 2 377.4258 –  Stat Feb 22 '14 at 5:09
@Stat, thanks! That's handy! –  Penguin_Knight Feb 22 '14 at 5:15
@Penguin_Knight Thanks so much!!! This has bugged me for quite awhile, finally understand why. Thanks –  user40693 Feb 24 '14 at 20:20
@user40693, you're welcome. This function looks pretty nifty as well. Thanks for introducing it to me. –  Penguin_Knight Feb 24 '14 at 20:30