Re: [R] Running different Regressions using for loops

2012-09-28 Thread David Winsemius
ve been much more "understandable". > > > Thanks for your time...and all the quick replies > > > -Original Message- > From: Rui Barradas [mailto:ruipbarra...@sapo.pt] > Sent: 28 September 2012 16:49 > To: Krunal Nanavati > Cc: David Winsemius;

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
48628 >> 445351 >> >> >> >> >> When I enter " lm.list2[[2]]$coefficient[2] " it gives me the below >> output >> >> Price2 >> -5759030 >> >> And when I enter " lm.list2[[2]]$coefficient[[2]] " ...I

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
Regards, Krunal Nanavati 9769-919198 -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: 28 September 2012 16:02 To: Krunal Nanavati Cc: David Winsemius; r-help@r-project.org Subject: Re: [R] Running different Regressions using for loops Hello, Try names(lm.

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
t; Price2 "is there a statement for that?? Thanks & Regards, Krunal Nanavati 9769-919198 -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: 28 September 2012 15:18 To: Krunal Nanavati Cc: David Winsemius; r-help@r-project.org Subject: Re: [R] Running

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Rui Barradas
2) } Thanks & Regards, Krunal Nanavati 9769-919198 -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: 28 September 2012 16:02 To: Krunal Nanavati Cc: David Winsemius; r-help@r-project.org Subject: Re: [R] Running different Regressions using for loops Hello, Try

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Rui Barradas
pt] Sent: 28 September 2012 15:18 To: Krunal Nanavati Cc: David Winsemius; r-help@r-project.org Subject: Re: [R] Running different Regressions using for loops Hello, To access list elements you need `[[`, like this: summ.list[[2]]$coefficients Or Use the extractor function, coef(summ.list[[2]]) Rui B

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Rui Barradas
arra...@sapo.pt] Sent: 27 September 2012 21:55 To: Krunal Nanavati Cc: David Winsemius; r-help@r-project.org Subject: Re: [R] Running different Regressions using for loops Hello, Inline. Em 27-09-2012 13:52, Krunal Nanavati escreveu: Hi, Thanks for all your help. I am stuck again, but with a new pr

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Gerrit Eichner
Hello, Krunal, try summ.list[[2]]$coefficients[2] Note the double square brackets (as summ.list is a list)! Hth, Gerrit On Fri, 28 Sep 2012, Krunal Nanavati wrote: Hi Rui, Excellent!! This is what I was looking for. Thanks for the help. So, now I have stored the result of the 10 regr

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
s & Regards, Krunal Nanavati 9769-919198 -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: 27 September 2012 21:55 To: Krunal Nanavati Cc: David Winsemius; r-help@r-project.org Subject: Re: [R] Running different Regressions using for loops Hello, Inline. Em 27-09-20

Re: [R] Running different Regressions using for loops

2012-09-27 Thread Rui Barradas
(as.formula(fmla), data = tryout2) } The trick is to use ?expand.grid Hope this helps, Rui Barradas I am not sure about its placement...whether it should be in loop 2 or in loop 1 Can you please help me out?? Thanks & Regards, Krunal Nanavati 9769-919198 -Original Message--

Re: [R] Running different Regressions using for loops

2012-09-27 Thread Krunal Nanavati
ith the" lm.list[[i]] <- lm(as.formula(fmla), data = tryout)" statement. I am not sure about its placement...whether it should be in loop 2 or in loop 1 Can you please help me out?? Thanks & Regards, Krunal Nanavati 9769-919198 -Original Message- From: Rui Barradas [m

Re: [R] Running different Regressions using for loops

2012-09-27 Thread Rui Barradas
erfectly. In R there is a difference between expression objects and character objects. Thanks & Regards, Krunal Nanavati 9769-919198 *From:* Rui Barradas [mailto:ruipbarra...@sapo.pt] *Sent:* 26 September 2012 17:13 *To:* Krunal Nanavati *Cc:* r-help@r-project.org *Subject:* Re: [R]

Re: [R] Running different Regressions using for loops

2012-09-27 Thread David Winsemius
work perfectly. In R there is a difference between expression objects and character objects. > Thanks & Regards, > > > > Krunal Nanavati > > 9769-919198 > > > > *From:* Rui Barradas [mailto:ruipbarra...@sapo.pt] > *Sent:* 26 September 2012 17:13 &

Re: [R] Running different Regressions using for loops

2012-09-26 Thread Krunal Nanavati
To:* Krunal Nanavati *Cc:* r-help@r-project.org *Subject:* Re: [R] Running different Regressions using for loops Hello, Try the following. #cnames <- names(tryout) # in your code, use this one cnames <- c("Volume", "Price1", "Price2", "Price3", &q

Re: [R] Running different Regressions using for loops

2012-09-26 Thread Rui Barradas
Hello, Try the following. #cnames <- names(tryout) # in your code, use this one cnames <- c("Volume", "Price1", "Price2", "Price3", "Price4", "Price5", "Trend", "Seasonaliy") price <- cnames[grep("Price", cnames)] resp <- cnames[1] regr <- cnames[7:8] #lm.list <- vector("list", 5) for(i in 1

[R] Running different Regressions using for loops

2012-09-26 Thread Krunal Nanavati
Hi, I am trying to run many different regressions using a FOR Loop. The input data that is read into R has the following variables · Volume · Price1 · Price2 · Price3 · Price4 · Price5 · Trend · Seasonality I want to