similar to: how to run stepAIC starting with NULL model?

Displaying 20 results from an estimated 2000 matches similar to: "how to run stepAIC starting with NULL model?"

2017 Jun 08
1
stepAIC() that can use new extractAIC() function implementing AICc
I would like test AICc as a criteria for model selection for a glm using stepAIC() from MASS package. Based on various information available in WEB, stepAIC() use extractAIC() to get the criteria used for model selection. I have created a new extractAIC() function (and extractAIC.glm() and extractAIC.lm() ones) that use a new parameter criteria that can be AIC, BIC or AICc. It works as
2005 Nov 03
1
Help on model selection using AICc
Hi, I'm fitting poisson regression models to counts of birds in 1x1 km squares using several environmental variables as predictors. I do this in a stepwise way, using the stepAIC function. However the resulting models appear to be overparametrized, since too much variables were included. I would like to know if there is the possibility of fitting models by steps but using the AICc
2010 Aug 17
2
how to selection model by BIC
Hi All: the package "MuMIn" can be used to select the model based on AIC or AICc. The code is as follows: data(Cement) lm1 <- lm(y ~ ., data = Cement) dd <- dredge(lm1,rank="AIC") print(dd) If I want to select the model by BIC, what code do I need to use? And when to select the best model based on AIC, what the differences between the function "dredge" in
2012 Sep 19
0
Lowest AIC after stepAIC can be lowered by manual reduction of variables (Florian Moser)
A few general comments about stepwiseAIC and a suggestion of how to select models a) Apart form the problem, that stepwise selection is not a garanty to get the best model, you need to have a lot of data to avoid overfitting if your model includes 7 parameter plus interactions (> 10 observations per parameter is what you are ideally looking for). b) Have a look at Anderson and Burnham's
2009 May 05
0
stepAICc function (based on MASS:::stepAIC.default)
Dear all, I have tried to modify the code of MASS:::stepAIC.default(), dropterm() and addterm() to use AICc instead of AIC for model selection. The code is appended below. Somehow the calculations are still not correct and I would be grateful if anyone could have a look at what might be wrong with this code... Here is a working example: ## require(nlme) model1=lme(distance ~ age + Sex, data =
2009 Jul 10
1
generalized linear model (glm) and "stepAIC"
Hi, I'm a very new user of R and I hope not to be too "basic" (I tried to find the answer to my questions by other ways but I was not able to). I have 12 response variables (species growth rates) and two environmental factors that I want to test to find out a possible relation. The sample size is quite small: (7<n<12, depending on each species-case). I performed a
2005 Nov 02
1
model selection based on AICc
Dear members of the list, I'm fitting poisson regression models using stepAIC that appear to be overparametrized. I would like to know if there is the possibility of fitting models by steps but using the AICc instead of AIC. Best wishes German Lopez
2002 Apr 01
0
something confusing about stepAIC
Folks, I'm using stepAIC(MASS) to do some automated, exploratory, model selection for binomial and Poisson glm models in R 1.3. Because I wanted to experiment with the small-sample correction AICc, I dug around in the code for the functions glm.fit stepAIC dropterm.glm addterm.glm extractAIC.glm and came across something I just don't understand. stepAIC() passes dropterm.glm() a
2009 Apr 30
1
stepAICc
Dear R users, Would it be difficult to change the code of stepAIC (from the MASS library) to use AICc instead of AIC? It would be great to know of someone has tried this already. Best wishes Christoph.
2003 Aug 04
1
Error in calling stepAIC() from within a function
Hi, I am experiencing a baffling behaviour of stepAIC(), and I hope to get any advice/help on what went wrong or I'd missed. I greatly appreciate any advice given. I am using stepAIC() to, say, select a model via stepwise selection method. R Version : 1.7.1 Windows ME Many thanks and best regards, Siew-Leng ***Issue : When stepAIC() is placed within a function, it seems
2006 Oct 11
1
Bug in stepAIC?
Hi, First of all, thanks for the great work on R in general, and MASS in particular. It's been a life saver for me many times. However, I think I've discovered a bug. It seems that, when I use weights during an initial least-squares regression fit, and later try to add terms using stepAIC(), it uses the weights when looking to remove terms, but not when looking to add them:
2003 May 02
2
stepAIC/lme (1.6.2)
Based on the stepAIC help, I have assumed that it only was for lm, aov, and glm models. I gather from the following correspondence that it also works with lme models. Thomas Lumley 07:40 a.m. 28/04/03 -0700 4 Re: [R] stepAIC/lme problem (1.7.0 only) Prof Brian Ripley 04:19 p.m. 28/04/03 +0100 6 Re: [R] stepAIC/lme problem (1.7.0 only) Prof Brian Ripley 06:09 p.m. 29/04/03 +0100 6 Re: [R]
2009 May 05
2
Stepwise logistic Regression with significance testing - stepAIC
Hello R-Users,   I have one binary dependent variable and a set of independent variables (glm(formula,…,family=”binomial”) ) and I am using the function stepAIC (“MASS”) for choosing an optimal model. However I am not sure if stepAIC considers significance properties like Likelihood ratio test and Wald test (see example below).     > y <- rbinom(30,1,0.4) > x1 <- rnorm(30) > x2
2017 Aug 22
1
boot.stepAIC fails with computed formula
Failed? What was the error message? Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Aug 22, 2017 at 8:17 AM, Stephen O'hagan <SOhagan at manchester.ac.uk> wrote: > I'm trying to use boot.stepAIC for
2007 Jun 05
1
Question using stepAIC
Hi - I use stepAIC to automatically select the model. The stepAIC was applied on polr as follow:objPolr <- polr(formula=myformula, data=dat, method=METHOD);objPolr.step <- stepAIC(objPolr, trace=T);Then R complaints that it doesn't know about 'dat' when it executes the second line. Below is the exact error that I got when executing the stepAIC line above:Error in eval(expr,
2017 Aug 22
0
boot.stepAIC fails with computed formula
The error is "the model fit failed in 50 bootstrap samples Error: non-character argument" Cheers, SOH. On 22/08/2017 17:52, Bert Gunter wrote: > Failed? What was the error message? > > Cheers, > > Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka
2017 Aug 22
1
boot.stepAIC fails with computed formula
SImplify your call to lm using the "." argument instead of manipulating formulas. > strt <- lm(y1 ~ ., data = dat) and you do not need to explicitly specify the "1+" on the rhs for lm, so > frm2<-as.formula(paste(trg," ~ ", paste(xvars,collapse = "+"))) works fine, too. Anyway, doing this gives (but see end of output)" bst <-
2003 Apr 28
2
stepAIC/lme problem (1.7.0 only)
I can use stepAIC on an lme object in 1.6.2, but I get the following error if I try to do the same in 1.7.0: Error in lme(fixed = resp ~ cov1 + cov2, data = a, random = structure(list( : unused argument(s) (formula ...) Does anybody know why? Here's an example: library(nlme) library(MASS) a <- data.frame( resp=rnorm(250), cov1=rnorm(250), cov2=rnorm(250),
2006 May 05
1
trouble with step() and stepAIC() selecting the best model
Hello, I have some trouble using step() and stepAIC() functions. I'm predicting recruitment against several factors for different plant species using a negative binomial glm. Sometimes, summary(step(model)) or summary(stepAIC(model) does not select the best model (lowest AIC) but just stops before. For some species, step() works and stepAIC don't and in others, it's the opposite.
2017 Jun 06
1
glm and stepAIC selects too many effects
This is a question at the border between stats and r. When I do a glm with many potential effects, and select a model using stepAIC, many independent variables are selected even if there are no relationship between dependent variable and the effects (all are random numbers). Do someone has a solution to prevent this effect ? Is it related to Bonferoni correction ? Is there is a ratio of