Re: [R] Problem to male an Index in looping

2008-09-27 Thread jim holtman
I think you want 'assign': for (i in 1:3){ assign(qrnox[i], rq(nox~factor(year)+factor(state)+pcinc+I(pcinc^2)+I(pcinc^3), tau=quant[i], data=exmp)) } better yet, use a list: result <- list() for (i in 1:3){ result[[1]] <- rq() } result[[1]] On Sat, Sep 27, 2008 at 4:24 PM, dimitrisk

[R] Problem to male an Index in looping

2008-09-27 Thread dimitrisk
Hi, I am trying to use (i) as an index but R considers it as a function and not as text. To be more specific I would like for example to estimate some regressions named qrnox1, qrnox2, qrnox3,. and so on. But when I am using qrnox(i) ot qrnox[i] it tries to find the ith element of vector qr