[R] Plotting of regsubsets adjr2 values not correct

Bert Gunter gunter.berton at gene.com
Tue Sep 25 17:27:06 CEST 2012


1. You failed to tell us that you are using the leaps package.

2. You are lost statistically. I strongly recommend that you seek out
local statistical help. At the very least, post on a statistical Help
list, which this is _not_.

3. FWIW: What you are trying to do is quite unwise. That is why I
suggested that you seek local help.

Cheers,
Bert

On Tue, Sep 25, 2012 at 8: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? This is also the case for the other models,
> e.g. when I do the simplest model in the graphic:
> summary(lm(Gesamt~ExpHealth))
> I get an adj. R squared of 0.009202 but the plot says something abou 0.14,
> so it is not correct? I don't know how to solve this problem, any help
> would be nice, thanks.
>
>
> 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?
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm




More information about the R-help mailing list