Dear All,I would like to do multiple regression in R. I used: lm(y~X),
where y is a n by 1 vector, and X is a n by m matrix. I kept getting the error
message:Error in model.frame.default(formula = y ~ X,  :  invalid type (list) 
for variable 'X'. However, when I used: lm(y~X[,1]+X[,2]+X[,3]+…+X[,m]), it
works well, but this is not the form I prefer, it makes my codes 
complicated.Please help.Thank you very much,Jane
______________________________________________
R-help@r-project.org 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.

Reply via email to