[R] Plotting of regsubsets adjr2 values not correct

Maximilian Lklweryc maxlklweryc at gmail.com
Tue Sep 25 17:03:31 CEST 2012


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?
-------------- n?chster Teil --------------
Ein Dateianhang mit Bin?rdaten wurde abgetrennt...
Dateiname   : regsubsets.png
Dateityp    : image/png
Dateigr??e  : 8954 bytes
Beschreibung: nicht verf?gbar
URL         : <https://stat.ethz.ch/pipermail/r-help/attachments/20120925/6c2a42c8/attachment.png>


More information about the R-help mailing list