[R] basic question re lm()

From: r user <ruser2006_at_yahoo.com>
Date: Fri 11 Aug 2006 - 08:17:18 EST

I am using R in a Windows environment.

I have a basic question regarding lm().

I have a dataframe “data1” with ncol=w.

I know that my dependent variable is in column1.

Is there a way to write the regression formula so that I can use columns 2 thru w as my independent variables?

e.g. something like: “ lm(data1[,1] ~ data1[,2:w] ) “


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Aug 11 08:23:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 11 Aug 2006 - 12:30:46 EST.

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