[R] Problem to male an Index in looping

dimitrisk gamitor at gmail.com
Sat Sep 27 22:24:31 CEST 2008


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 qrnox.
The thing is that I want to estimate the qrnoxi regression and not the
qrnox(i) function or whatever. Even if I create a vector text as elements
like qrnox<-c("qrnox1", "qrnox2", "qrnox3", .....). It doesn't work either.
Is there any way to do it ? I have post the part of the code 

Thanks

Dimitris

#######################################################
quant<-c(0.25, 0.5, 0.75)
qrnox<-c("qrnox1", "qrnox2", "qrnox3")

for (i in 1:3){
qrnox[i]<-rq(nox~factor(year)+factor(state)+pcinc+I(pcinc^2)+I(pcinc^3),
tau=quant[i], data=exmp)
}

summary(qrnox1)
-- 
View this message in context: http://www.nabble.com/Problem-to-male-an-Index-in-looping-tp19706138p19706138.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list