Re: [R] dynamically specifying regressors/RHS variables in a regression

2007-05-05 Thread Gabor Grothendieck
Using the builtin data frame CO2 this regresses uptake, which is variable number 5, against each consecutive pair of variables: for(i in 1:3) { idx - c(i, i+1, 5) print(lm(uptake ~., CO2[idx])) } On 5/5/07, Victor Bennett [EMAIL PROTECTED] wrote: Does anyone know if there is a way to

[R] dynamically specifying regressors/RHS variables in a regression

2007-05-04 Thread Victor Bennett
Does anyone know if there is a way to specify regressors dynamically rather than explicitly? More specifically, I have a data set in long format that details a number of individuals and their responses to a question (which can be positive, negative, or no answer). Each individual answers as many