Re: [R] stepAIC() that can use new extractAIC() function implementing AICc

2017-06-08 Thread Marc Girondot via R-help
I have found the problem and a solution. The problem comes from the functions addterm.glm() and dropterm.glm() from MASS package. They use extractAIC() without transmitting the ... argument: aic <- aic + (extractAIC(object, k = k)[2L] - aic[1L]) I replace the call with: aic <- aic + (extract

[R] stepAIC() that can use new extractAIC() function implementing AICc

2017-06-07 Thread Marc Girondot via R-help
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 e

[R] stepAIC with lm

2014-02-28 Thread renzo89
Hi everybody,I'm a beginner in R so this question it could may simple for u (I hope it).I need to study the interaction between 4 independent variables (x1, x2, x3, x4) and a dependent variable (y). So I've used a list of regression models (using the "lm" function) as:REGR.LIN<-lm(y~0+x1+x2+x3+x4)n

Re: [R] stepAIC problem

2013-08-22 Thread Prof Brian Ripley
On 22/08/2013 09:24, Sachinthaka Abeywardana wrote: Hi all, I get the expected behaviour of getting a useful model if I do the following This is an 'expectation problem', not a 'stepAIC problem'. And stepAIC is not part of R and you are not crediting the tools you use. fit<-lm( expressions

[R] stepAIC problem

2013-08-22 Thread Sachinthaka Abeywardana
Hi all, I get the expected behaviour of getting a useful model if I do the following fit<-lm( expressions[,i]~expressions[,pa_all[1]]+expressions[,pa_all[2]]+expressions[,pa_all[3]]+expressions[,pa_all[4]]+expressions[,pa_all[5]]) step<-stepAIC(fit, direction="both") Output: Step: AIC=-78.75 ex

[R] stepAIC with logistf function

2013-08-07 Thread Dustin Fife
Hi, I'm doing research with biodata where I'm trying to predict disease state from many biomarkers. Unfortunately it's not a common disease, so the sample size is small. When I run the model as a glm, it has separation issues. Consequently, I ran the model using logistf with no problems. Now, how

[R] stepAIC and AIC question

2012-11-02 Thread orzack
I have a question about stepAIC and extractAIC and why they can produce different answers. Here's a stepAIC result (slightly edited - I removed the warning about noninteger #successes): stepAIC(glm(formula = (Morbid_70_79/Present_70_79) ~ 1 + Cohort + Cohort2, family = binomial, data = ghs_7

Re: [R] why does R stepAIC keep unsignificant variables?

2012-10-09 Thread S Ellison
> > Why are the first 5 variables kept in the stepwise result?? I don't know, for your data set. However, AIC is in my limited experience less likely to reject a term than rejection based on p-value at 95% confidence. It's not the same criterion, so there's no immediate reason it should give th

Re: [R] why does R stepAIC keep unsignificant variables?

2012-10-09 Thread liang . che
: 10/08/2012 09:10 PM Subject:Re: [R] why does R stepAIC keep unsignificant variables? On Oct 8, 2012, at 5:43 PM, liang@us.pwc.com wrote: > Ran a bunch of variables in R and the final result of StepAIC is as below: > Why are the first 5 variables kept in the stepwise

Re: [R] why does R stepAIC keep unsignificant variables?

2012-10-08 Thread David Winsemius
On Oct 8, 2012, at 5:43 PM, liang@us.pwc.com wrote: > Ran a bunch of variables in R and the final result of StepAIC is as below: > Why are the first 5 variables kept in the stepwise result?? Are the last > 4 variables finally chosen after Stepwise? Thanks > > Coefficients: > Estimate Std

[R] why does R stepAIC keep unsignificant variables?

2012-10-08 Thread liang . che
Ran a bunch of variables in R and the final result of StepAIC is as below: Why are the first 5 variables kept in the stepwise result?? Are the last 4 variables finally chosen after Stepwise? Thanks Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.315e-01 2.687e-01 0.490 0.6361

Re: [R] stepAIC in R

2012-10-03 Thread Uwe Ligges
On 03.10.2012 19:48, liang@us.pwc.com wrote: My stepAIC function works for one set of data but not anotherone set of data shows the steps of eliminating variables, versus another set of data doesn't throw away any variables. Can anyone please explain why? Without data nor output? No.

[R] stepAIC in R

2012-10-03 Thread liang . che
My stepAIC function works for one set of data but not anotherone set of data shows the steps of eliminating variables, versus another set of data doesn't throw away any variables. Can anyone please explain why? Thanks __ T

Re: [R] stepAIC error

2012-02-21 Thread Ben Bolker
labbig windowslive.com> writes: > > i am trying to run stepwise regression for two models(lower,upper), > family=gamma > and i get the same error despite the models i use. > > Error in UseMethod("extractAIC") : > no applicable method for 'extractAIC' applied to an object of class > "formula"

[R] stepAIC error

2012-02-21 Thread labbig
i am trying to run stepwise regression for two models(lower,upper), family=gamma and i get the same error despite the models i use. Error in UseMethod("extractAIC") : no applicable method for 'extractAIC' applied to an object of class "formula" In addition: Warning message: In nobs.default(obje

[R] stepAIC

2011-11-21 Thread David martin
Hi, I'm trying to select the best model for a particular problem. So far i have managed to identify a set of variables that woudl explain my model lm1 <- lm(Group ~ . , data=dataf)) > summary(lm1) Df Sum Sq Mean Sq F valuePr(>F) `A` 1 2.3963 2.3963 24.0390 7.328e-06

[R] StepAIC and boxplot

2011-11-18 Thread David martin
Hello, I have done a stepwise analysis to determine the best model fitting my data. data <- stepAIC( aov (Group)~ . , data=mydata) data > summary(data) Df Sum Sq Mean Sq F valuePr(>F) `a` 1 1.9829 1.98290 11.176 0.0011824 ** `b` 1 2.6606 2.66064 14.996 0.0001967 ***

Re: [R] stepAIC: plot predicted versus observed

2010-12-14 Thread sergeetienneparent
I figured out how to call coefficients and R² from the summary. - fit<-lm(...) #multiple regression function stepComp <- stepAIC(fit, direction="both") summary(stepComp)$coef[1,1] #call first coefficient summary(stepComp)$coef[1,2] #call Std. Error of first coefficient summary(ste

[R] stepAIC: plot predicted versus observed

2010-12-13 Thread sergeetienneparent
Hi, stepAIC generic plot function creates useful graphics for the diagnosis of multiple regressions. To create predicted versus observed plots, I use to look for the coefficients, copy them by hand, calculate R², then plot. Is there a more automated way to plot predicted versus observed with its

Re: [R] stepAIC function

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 9:29 AM, Ashta wrote: Hi All, I am trying to run the following script but have problem, coxm<- coxph(Surv(sdat$time, sdat$cens)~hd+nawtg+nwwg+ntpg+cy +nseas,data=sdat) coxm<-stepAIC(coxm,~.^2) The error message is Error: could not find function "stepAIC" Perhaps you h

[R] stepAIC function

2009-12-04 Thread Ashta
Hi All, I am trying to run the following script but have problem, coxm<- coxph(Surv(sdat$time, sdat$cens)~hd+nawtg+nwwg+ntpg+cy+nseas,data=sdat) coxm<-stepAIC(coxm,~.^2) The error message is Error: could not find function "stepAIC" I tried to install the package but I could not find it. Where

[R] stepAIC(coxph) forward selection

2009-11-04 Thread Rupa Parvataneni
Dear R-Help, I am trying to perform forward selection on the following coxph model: >my.bpfs <- Surv(bcox$pfsdays, bcox$pfscensor) > b.cox <- coxph(my.bpfs ~ Cbase + Abase + Cbave + CbSD + KPS + gender + as.factor(eor) + Age)>stepAIC(b.cox, scope=list(upper =~ Cbase + Abase + Cbave + CbSD + KPS +

[R] stepAIC + cox.zph

2009-05-11 Thread Eric Rescorla
Hi, I'm using stepAIC with a CoxPH model on some data. As we expect, there are a bunch of predictors, and stepAIC throws some out and then converges on others. Anyway, when I run cox.zph on the final model, I get some evidence of Beta(t) time dependence. Should I be concerned about the impact of

Re: [R] StepAIC with coxph

2009-01-28 Thread Ravi Varadhan
Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: Michele Santacatterina Date: Wednesday, January 28, 2009 9:51 am Subject: [R] StepAIC with coxph To: R-help@r-project.org > Hi, > > i'm trying to

[R] StepAIC with coxph

2009-01-28 Thread Michele Santacatterina
Hi, i'm trying to apply StepAIC with coxph...but i have the same error: stepAIC(fitBMT) Start: AIC=327.77 Surv(TEMPO,morto==1) ˜ VOD + SESSO + ETA + Error in dropterm.default(fit,scope$drop, scale=scale,trace=max(0, : number of rows in use has changed: remove missing values? anybody

Re: [R] stepAIC {MASS}

2008-06-21 Thread Frank E Harrell Jr
Nathan Leon Pace, MD, MStat wrote: In a generalized linear model with k covariates, there are 2(kth power) - 1 possible models (excluding interactions). Awhile ago a posting to R-help suggested Model Selection and Multimodel Inference, 2nd ed, by Burnham and Anderson as a good source for underst

[R] stepAIC {MASS}

2008-06-20 Thread Nathan Leon Pace, MD, MStat
In a generalized linear model with k covariates, there are 2(kth power) - 1 possible models (excluding interactions). Awhile ago a posting to R-help suggested Model Selection and Multimodel Inference, 2nd ed, by Burnham and Anderson as a good source for understanding model selection. They recommen

Re: [R] stepAIC and polynomial terms

2008-03-16 Thread Bill.Venables
bles. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of caspar Sent: Monday, 17 March 2008 11:50 AM To: r-help@r-project.org Subject: [R] stepAIC and polynomial terms Dear all, I have a question regarding the use of stepAIC and polynomial (quadratic to

Re: [R] stepAIC and polynomial terms

2008-03-16 Thread Robert A LaBudde
At 08:50 PM 3/16/2008, caspar wrote: >Dear all, >I have a question regarding the use of stepAIC and polynomial >(quadratic to be specific) terms in a binary logistic regression >model. I read in McCullagh and Nelder, (1989, p 89) and as far as I >remember from my statistics cources, higher-degre

[R] stepAIC and polynomial terms

2008-03-16 Thread caspar
Dear all, I have a question regarding the use of stepAIC and polynomial (quadratic to be specific) terms in a binary logistic regression model. I read in McCullagh and Nelder, (1989, p 89) and as far as I remember from my statistics cources, higher-degree polynomial effects should not be include