[R] Linear Regression ?

kayj kjaja27 at yahoo.com
Mon Jun 16 16:27:40 CEST 2008


Hi All,

I have a data with 15 columns. the first 10 column are dependent(y’s)
variables and the following 5  an columns are the independent variables(x’s)
( MY DATA HAS A HEADER WITH THE NAME OF THE VAIABLES). I need to apply
linear regression y=a+bx where I need x to be one of the independent
variable and y to be one of the dependent variable, but for each x I have to
repeat the model for all 5 independent variable  one at a time .

Also each x is a categorical variable with 4 categories so I have to
introduce  three variables for each x 

	New Variable 1	New Variable 2	New Variable 3
Category 1	0	0	0
Category 2	1	0	0
Category 3	0	1	0
Category 4	0	0	1


I want R to print out the summary and the analysis of variance for each
model.

How can this done in R? I want to use some loop that loops over the
independent variables for each x ?Also , I am not sure how to deal with the
problem of each x being a categorical variable and I have to create these
new variables for each x? 

I hope that someone can help. I really Appreciate it.

-- 
View this message in context: http://www.nabble.com/Linear-Regression---tp17865662p17865662.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list