[R] stepAIC on lm() where response is a matrix..

2007-06-27 Thread vinod gullu
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

Re: [R] stepAIC on lm() where response is a matrix..

2007-06-27 Thread Spencer Graves
I see several options for you: 1. Write a function 'dropterm.mlm', copying 'dropterm.lm' and modifying it as you think appropriate. The function 'dropterm.lm' is hidden in a namespace, which you can see from 'methods(dropterm)'. To get it, either use getAnywhere(dropterm.lm) or

Re: [R] stepAIC on lm() where response is a matrix..

2007-06-27 Thread Prof Brian Ripley
On Wed, 27 Jun 2007, Spencer Graves wrote: I see several options for you: 1. Write a function 'dropterm.mlm', copying 'dropterm.lm' and modifying it as you think appropriate. The function 'dropterm.lm' is hidden in a namespace, which you can see from 'methods(dropterm)'. To get

[R] stepAIC for lmer

2006-12-04 Thread Marc Bernard
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 -

[R] stepAIC

2006-12-04 Thread Marc Bernard
Sorry I made a mistake for the variables in the model: fm0.lmer - lmer(Y ~ time+x1+x2 + (1|ID), data = dfr, family = binomial) fm.lmer - stepAIC(fm0.lmer,scope = list(upper = ~ time*x1*x2, lower = ~1,trace = FALSE)) I obtain the following error: Error in

Re: [R] stepAIC for lmer

2006-12-04 Thread Prof Brian Ripley
On Mon, 4 Dec 2006, Marc Bernard wrote: Dear All, I am trying to use stepAIC for an lmer object but it doesn't work. Here is an example: No, and it is not documented to work with lmer objects. stepAIC is support software for a book, and lmer is not discussed in that book (and postdates

[R] stepAIC for overdispersed Poisson

2006-11-13 Thread Murray Jorgensen
I am wondering if stepAIC in the MASS library may be used for model selection in an overdispersed Poisson situation. What I thought of doing was to get an estimate of the overdispersion parameter phi from fitting a model with all or most of the available predictors (we have a large number of

Re: [R] stepAIC for overdispersed Poisson

2006-11-13 Thread Prof Brian Ripley
On Mon, 13 Nov 2006, Murray Jorgensen wrote: I am wondering if stepAIC in the MASS library may be used for model selection in an overdispersed Poisson situation. What I thought of doing was to get an estimate of the overdispersion parameter phi from fitting a model with all or most of the

[R] stepAIC

2006-09-12 Thread stephenc
Hi I hope this isn't off topics, but I have always found when I stepAIC() some glm I get an improvement in accuracy and kappa, but I have just done a case where I got a marginal deterioration. Is this possible, or should I be going through my figures carefully to see if I have messed up?

Re: [R] stepAIC

2006-09-12 Thread Prof Brian Ripley
On Tue, 12 Sep 2006, stephenc wrote: Hi I hope this isn't off topics, but I have always found when I stepAIC() some glm I get an improvement in accuracy and kappa, but I have just done a case where I got a marginal deterioration. Is this possible, or should I be going through my

Re: [R] stepAIC formula upper limit guidelines

2005-10-25 Thread Uwe Ligges
Tate Avery wrote: Hello, I am attempting to refine an lm()-generated model using the stepAIC function. My model has approximately 20 inputs and I am trying to determine the best upper limit scope for using those inputs. My lower limit is y ~ 1 and my original upper limit was y ~ x1 +

[R] stepAIC formula upper limit guidelines

2005-10-24 Thread Tate Avery
Hello, I am attempting to refine an lm()-generated model using the stepAIC function. My model has approximately 20 inputs and I am trying to determine the best upper limit scope for using those inputs. My lower limit is y ~ 1 and my original upper limit was y ~ x1 + x2 + ... + x20. This is

[R] stepAIC invalid scope argument

2005-08-16 Thread John Wilkinson \(pipex\)
Adai, The following works.Perhaps you should define your 'upper' and 'lower' in the list as aov's, as you have done with your lo,hi and mid. John stepAIC( mid, scope=list(upper = mid , lower = lo) ) Start: AIC= -594.66 y ~ x2 + x3 Df Sum of Sq RSS AIC - x21 0.11

Re: [R] stepAIC invalid scope argument

2005-08-16 Thread Adaikalavan Ramasamy
Thank you. Your suggestion is equivalent is the same as my second stepAIC command that failed in R-2.1.1. See Prof. Ripley's reply where he pointed out that this was due to using the name 'df' which clashes with built-in function with the same name from stats package. Regards, Adai On Tue,

[R] stepAIC invalid scope argument

2005-08-15 Thread Adaikalavan Ramasamy
I am trying to replicate the first example from stepAIC from the MASS package with my own dataset but am running into error. If someone can point where I have gone wrong, I would appreciate it very much. Here is an example : set.seed(1) df - data.frame( x1=rnorm(1000), x2=rnorm(1000),

Re: [R] stepAIC invalid scope argument

2005-08-15 Thread Prof Brian Ripley
Try not to use the name of an R object ... the error is caused by using 'df' as the second argument to eval(). It works with DF in place of df. I don;t understand your subject line: that is not the error message you received. On Mon, 15 Aug 2005, Adaikalavan Ramasamy wrote: I am trying to

Re: [R] stepAIC invalid scope argument

2005-08-15 Thread Prof Brian Ripley
In case it is unclear why in this case there is a problem: you are running a function (here model.frame) in the stats namespace and so it looks in the stats namespace before the workspace when looking for 'df'. On Mon, 15 Aug 2005, Prof Brian Ripley wrote: Try not to use the name of an R

Re: [R] stepAIC invalid scope argument

2005-08-15 Thread Adaikalavan Ramasamy
You are right, it works fine with a different name. Its a bad habit that I need to shake off. The error message said that the second argument was invalid. The second argument in stepAIC and addterm is 'scope' and thus the title. Thank you again. Regards, Adai On Mon, 2005-08-15 at 15:23

Re: [R] stepAIC invalid scope argument

2005-08-15 Thread Prof Brian Ripley
On Mon, 15 Aug 2005, Adaikalavan Ramasamy wrote: You are right, it works fine with a different name. Its a bad habit that I need to shake off. The error message said that the second argument was invalid. The second argument in stepAIC and addterm is 'scope' and thus the title. OK, we'll

[R] StepAIC with coxph

2004-11-02 Thread Neil Leonard
Hi, I'm having a bit of trouble with using StepAIC with a coxph model. Can anybody tell me if there is anything wrong with what I am doing here (I've removed a few of the variables for the purpose of this email, I had about 20 before): start-

[R] StepAIC

2004-03-29 Thread Christian Hennig
Dear list, here is an example of stepAIC that I do not understand. The data is n=42, Lage is the only factor and there are four other variables treated as continuous. First you see the stepAIC-forward solution (fs7). The strange thing here is that apparently not all interactions are tried for

Re: [R] StepAIC

2004-03-29 Thread Jari Oksanen
On 29 Mar 2004, at 19:07, Christian Hennig wrote: Dear list, First you see the stepAIC-forward solution (fs7). The strange thing here is that apparently not all interactions are tried for inclusion, but only WQ:Lage. In particular, I think that WFL:Lage should be tried in the last two steps,

Re: [R] stepAIC problem

2003-10-12 Thread Bernardo Rangel Tura
At 09:46 05-10-2003, Hiroto Miyoshi wrote: Dear R-users I have a probelm running stepAIC in R1.7.1 (...) --small example library(MASS) x1-runif(100) x2-runif(100) x3-runif(100) x4-runif(100) x5-runif(100) y-x1+x2+x3+runif(100) t-data.frame(y=y,x1=x1,x2=x2,x3=x3,x4=x4,x5=x5)

[R] stepAIC problem

2003-10-05 Thread Hiroto Miyoshi
Dear R-users I have a probelm running stepAIC in R1.7.1 I wrote a program which used stepAIC as a part of it, and it worked fine while I was using the previous version of R1.7.0. However, I found the program did not work any more. Now, R produces a message which tells "Error

Re: [R] stepAIC problem

2003-10-05 Thread A.J. Rossini
Hiroto Miyoshi [EMAIL PROTECTED] writes: Could anyone help me please? --small example library(MASS) x1-runif(100) x2-runif(100) x3-runif(100) x4-runif(100) x5-runif(100) y-x1+x2+x3+runif(100) t-data.frame(y=y,x1=x1,x2=x2,x3=x3,x4=x4,x5=x5) It is going to be very unhappy if it tries to

[R] stepAIC()

2003-07-30 Thread Siew Leng TENG
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