search for: adjr2

Displaying 16 results from an estimated 16 matches for "adjr2".

Did you mean: addr2
2007 May 21
4
How to compare linear models with intercept and those without intercept using minimizing adjs R^2 strategy
...those without intercept using maximizing adjusted R^2 strategy. Now I do it like the following: > library(leaps) > n=20 > x=matrix(rnorm(n*3),ncol=3) > b=c(1,2,0) > intercept=1 > y=x%*%b+rnorm(n,0,1)+intercept > > var.selection=leaps(cbind(rep(1,n),x),y,int=F,method="adjr2") > ##### Choose the model with maximum adjr2 > var.selection$which[var.selection$adjr2==max(var.selection$adjr2),] 1 2 3 4 TRUE TRUE TRUE FALSE Actually, I use the definition of R-square in which the model is without a intercept term. Is what I am doing is correct?...
2012 Sep 25
3
Plotting of regsubsets adjr2 values not correct
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 th...
2002 Feb 12
1
Best Subsets regression
Hi, I have found a minor problem with leaps(). In 1.3.1 under Windows 2000 I seem to only be able to obtain values for one statistic at a time. That is choosing method=c("Cp","adjr2","r2") just gives Cp values. To mimic the output of Minitab's MTB > BReg 'Fertility' 'Agriculture'-'Infant.Mortality' ; SUBC> NVars 1 5; SUBC> Best 5; SUBC> Constant. I need to go data(swiss) leapa <-leaps(as.matrix(swiss[,-1]),sw...
2005 Sep 27
4
regsubsets selection criterion
Hello, I am using the 'regsubsets' function (from leaps package) to get the best linear models to explain 1 variable from 1 to 5 explanatory variables (exhaustive search). Is there anyone who can tell me on which criterion is based the 'regsubsets' function ? Thank you. samuel Samuel BERTRAND Doctorant Laboratoire de Biomecanique LBM - ENSAM - CNRS UMR 8005
2009 Feb 25
1
leaps question
Colleagues, please help me with the simple question. How can I find R2 and p while doing best subsets regression? Also how can I see B and p for coefficients? Maybe you can advice me detailed manual, because in manual for the package this is not described. Thank you
2012 Sep 25
2
Regsubsets model selection
...elect the best adj. R squared model by using the regsubsets command, so I code: > plot(regsubsets(Gesamt ~ CommunistSocialist + CountrySize + GNI + Lifeexp + Schoolyears + ExpMilitary + Mortality + + PopPoverty + PopTotal + ExpEdu + ExpHealth, data=olympiadaten, nbest=1, nvmax=12), scale='adjr2') Then I get the picture I attached. The problem is, that the best model has an adjusted R squard of 0.49. But if I regress e.g. my y on only the variable PopTotal, then I already get an adjusted R squared of 0.779! So this simple model is way better but it is not recognized by the regsubsets...
2002 Sep 11
1
Problem with leaps (long)
...xlab=expression(p), ylab=expression(C[p])) -------------------------------------------------- While on the same topic, the help on line advocates the use of function regsubsets, which is said to improve on leaps on several ways. However, I see no way to select different criteria (Cp, R2, adjR2) in said function. I am using R 1.5.1 under Debian/Linux 3.0 (kernel 2.4.18, gcc -v reports "gcc version 2.95.4 20011002", if that matters). Many thanks for any help. ft. -- Fernando TUSELL e-mail: Departamento de Econometr?a y Estad?stica et...
2010 Feb 12
1
all possible subsets, with AIC
...thing better. Since the algorithm returns a best model of each size, the results do not depend on a penalty model for model size: it doesn't make any difference whether you want to use AIC, BIC, CIC, DIC, ... USAGE leaps(x=, y=, wt=rep(1, NROW(x)), int=TRUE, method=c("Cp", "adjr2", "r2"), nbest=10, names=NULL, df=NROW(x), strictly.compatible=TRUE) ARGUMENTS x A matrix of predictors y A response vector wt Optional weight vector int Add an intercept to the model method Calculate Cp, adjusted R-squared or R-squared nbest...
2006 Dec 11
1
organizing stats from a list of models
Hi there, I have a list of models (about 600 glm models) and I included the prefix "mod_" on their name. Now I would like retrieve the list from the R environment and save their AICs (and other info) on a table. I´m trying something like: ------------------------- y<-runif(20,min=0,max=1) x1<-runif(20,min=0,max=1) x2<-runif(20,min=0,max=1) mymod_1
2007 Oct 03
0
leaps: regsubsets, formula including interactions
...variables vi. Furthermore, I would like to add interaction effects to the model, is this also possible with the '.'? > library(leaps) > d<-regsubsets(SumTL~.,nbest=2,data=dat[,-c(2,9)]) > x11() ; par(mfrow=c(1,4)) ; plot(d) ; plot(d,scale="Cp") ; plot(d,scale="adjr2") ; plot(d,scale="r2") My data 'dat' variable looks like this: > str(dat) 'data.frame': 548 obs. of 9 variables: $ SumTL: int 13500 67800 158000 299000 486000 712000 56100 162000 310000 471000 ... $ SumUL: int 13800 69700 163000 308000 497000 726000 58100...
2008 Aug 13
2
which alternative tests instead of AIC/BIC for choosing models
Dear R Users, I am looking for an alternative to AIC or BIC to choose model parameters. This is somewhat of a general statistics question, but I ask it in this forum as I am looking for a R solution. Suppose I have one dependent variable, y, and two independent variables, x1 an x2. I can perform three regressions: reg1: y~x1 reg2: y~x2 reg3: y~x1+x2 The AIC of reg1 is 2000, reg2 is
2004 Apr 05
0
Selecting Best Regression Equation : leaps() in R and stepwise() in S+
...the message - Error in leaps.exhaustive(a) : Exhaustive search will be S L O W, must specify really.big=T -------------------------------------- 1. What to do ? I don't understand where to set really.big=T. 2. Why do we need strictly.compatible=T ? 3. Can we simultaneously use Cp, r2, adjr2 in method? 4. I still have problem with FORWARD / BACKWARD / STEPWISE methods. Can anyone please help me to solve the above problem by using these methods (I use R 1.7.1)? 5. In S-plus 4, is the following command correct for the above problem? - it seem to give me too many calculations and...
2007 Aug 08
1
Regsubsets statistics
Dear R-help, I have used the regsubsets function from the leaps package to do subset selection of a logistic regression model with 6 independent variables and all possible ^2 interactions. As I want to get information about the statistics behind the selection output, I?ve intensively searched the mailing list to find answers to following questions: 1. What should I do to get the statistics
2007 Oct 02
0
Variable selection in R
...ch corresponds to the first variable ? Popul has a 3 star rating in lm and nothing in step. How do I interpret that ? * all-subsets regression * > summary(tonall)$cp [1] 37.338138 31.452375 25.300272 17.965950 13.751043 10.021910 8.455827 8.810498 9.273599 11.000000 > summary(tonall)$adjr2 [1] 0.2155976 0.2411378 0.2680048 0.2997661 0.3197652 0.3381030 0.3481410 0.3506880 0.3528339 0.3499369 > summary(tonall)$which[1,][summary(tonall)$which[1,]] (Intercept) DistMarche > summary(tonall)$which[2,][summary(tonall)$which[2,]] (Intercept), NbCentresTriDs100km, DistMarche &gt...
2009 Sep 28
4
Running an ANOVA with a BY
I have a simple 1 way anova coded like summary(ANOVA1way <- aov(Value ~ WellID, data = welldata)) How can I use the BY function to do this ANOVA for each group using another variable in the dataset?? I tried coding it like this, but it doesn't seem to work. summary(ANOVA1way <- by(welldata, Analyte, function(x) aov(Value ~ WellID, data = welldata))) In SAS I would code it like this:
2006 Jan 10
2
Obtaining the adjusted r-square given the regression coefficients
Hi people, I want to obtain the adjusted r-square given a set of coefficients (without the intercept), and I don't know if there is a function that does it. Exist???????????????? I know that if you make a linear regression, you enter the dataset and have in "summary" the adjusted r-square. But this is calculated using the coefficients that R obtained,and I want other coefficients