[R] Loop for in R to generate several variables

From: arpino <bruno.arpino_at_unibocconi.it>
Date: Mon, 07 Apr 2008 02:31:57 -0700 (PDT)

Hi everybody,
I have to create several variables of this form:

Yind = L0 + L1*X1 + L2*X2 + L3*X3 + K*Cind + n

where ind varires in {1,...,10}

I thought to this loop for but it does not work:

for (ind in 1:10) {

 Yind = L0 + L1*X1 + L2*X2 + L3*X3 + K*Cind + n


Any suggestions?

Thank you.

View this message in context: http://www.nabble.com/Loop-for-in-R-to-generate-several-variables-tp16536683p16536683.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 07 Apr 2008 - 09:42:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Apr 2008 - 11:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive