[R] subset function

2007-02-08 Thread Simon P. Kempf
Hello R-Users, I have the following problem with the subset function: See the following simple linear model. Here everything works fine: >germany<-lm(RENT~AGE1, in.mi01) However, if a use the same regression equation and only specify a subset, I get an error message: > berlin<-l

Re: [R] subset function

2007-02-09 Thread Petr Pikal
Date sent: Fri, 9 Feb 2007 07:21:00 +0100 Subject:[R] subset function > Hello R-Users, > > > > I have the following problem with the subset function: > > > > See the following simple linear model. Here everything works fine: > &g

[R] Subset function of lm(); "rolling regressions"

2004-02-09 Thread Ajay Shah
Folks, I asked a question on this mailing list about the subset support of lm(). In a flash, I got three helpful responses from Rajarshi Guha <[EMAIL PROTECTED]> Erin Hodgess <[EMAIL PROTECTED]> and Peter Dalgaard <[EMAIL PROTECTED]> :-) and it was just great. The mis

[R] Subset function of lm(); "rolling regressions"

2004-02-09 Thread Ole F. Christensen
You need brackets in i:(i+25) 3:3+25 is not want you 3:(3+25) is what you want. to explicitly print out values in a for loop you need to use print for (i in 1:10) { print(i) } Ole -- Ole F. Christensen Center for Bioinformatik Aarhus Universitet Ny Munkegade, Bygning 540 8000 Aarhus C _

[R] Subset function of lm() does not seem to work

2004-02-06 Thread Ajay Shah
Folks, I have an elementary question about the lm() function, where I'm trying to exploit the "subset" feature, to make it use only a subset of the observations. My code is: -- A <- read.table(file="datafile.2", col

Re: [R] Subset function of lm() does not seem to work

2004-02-07 Thread Peter Dalgaard
Ajay Shah <[EMAIL PROTECTED]> writes: > # Subset vector : the 1st 25 are on, the remaining 75 are off. > window = c(rep(1,25), rep(0,75)) > > model <- lm(dlinrchf ~ dlusdchf + dljpychf + dldemchf, A, window) > summary(model) >