Re: [R] Loop for in R to generate several variables

2008-04-07 Thread Barry Rowlingson
Gustaf Rydevik wrote: > On Mon, Apr 7, 2008 at 11:31 AM, arpino <[EMAIL PROTECTED]> wrote: >> 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} > > look up ?assign and ?get, i.e: > for (

Re: [R] Loop for in R to generate several variables

2008-04-07 Thread Gustaf Rydevik
On Mon, Apr 7, 2008 at 11:31 AM, arpino <[EMAIL PROTECTED]> wrote: > > 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

[R] Loop for in R to generate several variables

2008-04-07 Thread arpino
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? Tha