Displaying 20 results from an estimated 900 matches similar to: "model selection, stepAIC(), and coxph() (fwd)"
2006 Mar 31
1
add1() and glm
Hello,
I have a question about the add1() function and quasilikelihoods for GLMs.
I am fitting quasi-Poisson models using glm(, family = quasipoisson).
Technically, with the quasilikelihood approach the deviance does not have
the interpretation as a likelihood-based measure of sample information.
Functions such as stepAIC() cannot be used. The function add1() returns
the change in the scaled
2006 Apr 20
3
the difference between "x1" and x1
Hello,
I am not sure what to write in the subject line, but I would like to take
a character string that is a variable in a data frame and apply a function
that takes a numeric argument to this character string.
Here is a simplified example that would solve my problem.
Imagine I have my data stored in a data frame.
> x1 <- x2 <- x3 <- x4 <- x5 <- rnorm(20,0,1);
> data <-
2006 Apr 13
2
assignment to a symbol created by paste
Hello,
I am creating a number of objects that I wish to have a common name with
an index such as x1, x2, x3, ... I would like to do everyting in a loop to
make the code compact and minimize the probability of an error by typo.
A test problem may look like
for (j in 1:10){
as.symbol(paste("x",j,sep="")) <- j;
}
which ideally would produce x1 = 1, ... x10 = 10. However,
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]
2006 Apr 07
1
how to run stepAIC starting with NULL model?
Hello,
I'm trying to figure out how to run the stepAIC function starting with the
NULL model. I can call the null model (e.g., lm(y ~ NULL)), but using
this object in stepAIC doesn't seem to work.
The objective is to calculate AICc. This can be done if stepAIC can be
run starting with the NULL model; the (2p(p-1)/(n-p-1))to get AICc would
be added to the final step AIC value. Can
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:
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
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,
2003 Jul 30
0
stepAIC()
Hi,
I am experiencing a baffling behaviour of stepAIC(),
and I hope to get any advice/help on this. Greatly
appreciate any kind advice given.
I am using stepAIC() to, say, select a model via
stepwise selection method.
R Version : 1.7.1
Windows ME
Many thanks!
***Issue :
When stepAIC() is placed within a function, it seems
that stepAIC() cannot detect the data matrix, and the
program is
2012 Nov 02
0
stepAIC and AIC question
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_70_79, subset =
ghs_70_full),direction = c("backward"))
Start: AIC=3151.41
2003 Jun 16
1
stop criterion for stepAIC
Hello,
I am using the function stepAIC (library MASS) to run a backward
elimination on my linear regression. The new model stepAIC calculates
contains coefficients that have a Pr(>|t|) value below 0.1, but I'd
like to have only coefficients with 0.001 or below.
How can I change the stop criterion for stepAIC, so that it is more
strict? There is a parameter "steps", but it is
2011 Nov 29
0
Any function\method to use automatically Final Model after bootstrapping using boot.stepAIC()
Hi List,
Being new to R, I am trying to apply boot.stepAIC() for Model selection by
bootstrapping the stepAIC() procedure. I had gone through the discussion in
various thread on the variable selection methods. Understood the pros and
cons of various method, also going through the regression modelling
strategies in rms.
I want to read Final model or Formula or list of variables automatically
2007 Jun 27
1
stepAIC on lm() where response is a matrix..
dear R users,
I have fit the lm() on a mtrix of responses.
i.e M1 = lm(cbind(R1,R2)~ X+Y+0). When i use
summary(M1), it shows details for R1 and R2
separately. Now i want to use stepAIC on these models.
But when i use stepAIC(M1) an error message comes
saying that dropterm.mlm is not implemented. What is
the way out to use stepAIC in such cases.
regards,
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),
2009 Jan 28
1
StepAIC with coxph
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 know this error??
Thanks.
Michele
[[alternative HTML version deleted]]
2006 Dec 04
1
stepAIC for lmer
Dear All,
I am trying to use stepAIC for an lmer object but it doesn't work. Here is an example:
x1 <- gl(4,100)
x2 <- gl(2,200)
time <- rep(1:4,100)
ID <- rep(1:100, each=4)
Y <- runif(400) <=.5
levels(Y) <- c(1,0)
dfr <- as.data.frame(cbind(ID,Y,time,x1,x2))
fm0.lmer <- lmer(Y ~ time+x1+x2 + (1|ID), data = dfr, family = binomial)
2003 Jun 18
1
3-way Interactions w/ stepAIC
I'm attempting to use stepAIC to select a model through a forward procedure.
I want to consider up to all 3-way interactions.
I've attempted to use the following code:
m2.Fwd3way <- stepAIC(m1.Ionly, direction="forward",
scope=list(upper=~(var1 + var2 + var3 + var4)^3,
lower=~1))
When I submit this the trace indicates that only 2-way
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
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
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