Skip to content
Back to formatted view

Raw Message

Message-ID: <CAJ55+dK4eFCh_OgV+SHyePSmEO2TYXawBQBLVWyBoEU14gOTjw@mail.gmail.com>
Date: 2012-09-25T20:36:29Z
From: Thomas Lumley
Subject: Plotting of regsubsets adjr2 values not correct
In-Reply-To: <CAK-iY6PwQYGtomWc=07SbRp9MsNFnskpbD4_HNtZDC3zfvxjww@mail.gmail.com>

On Wed, Sep 26, 2012 at 3:03 AM, Maximilian Lklweryc
<maxlklweryc at gmail.com> wrote:
> Hi,
> I want to make model selection with regsubsets. My code is:
>
> a<-regsubsets(Gesamt ~ CommunistSocialist + CountrySize + GNI + Lifeexp +
> Schoolyears + ExpMilitary + Mortality +
>   PopPoverty + PopTotal + ExpEdu + ExpHealth, data=olympiadaten, nbest=2)
> summary(a)
> plot(a,scale="adjr2")
>
> (output attached)
>
> The problem is now, that I want to fit the best model again "manually" and
> have a look at it, but the value of the adjusted R squared is not the same
> as in the regsubsets output?

Hard to tell: you haven't given us any way to reproduce what you did.
For the data example in the package the adjusted r2 values from
individual models match up with the ones on the graph. I've checked
another couple of data sets and they also agree.


>
> Also I do not understand, which models are shown there, e.g. the simple
> model just with an intercept and the variable GNI is not shown in the plot,
> why?

You asked for the two best models of each size, so you get the two
best models of each size.


   -thomas

-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland