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
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
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
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
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
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
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
> > 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
: 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
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
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
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.
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
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"
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
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
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 ***
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
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
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
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
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 +
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
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
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
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
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
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
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
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
30 matches
Mail list logo