Re: [R] automating regression or correlations for many variables

From: geral <geraldes_at_mail.ubc.ca>
Date: Mon, 04 Apr 2011 15:33:15 -0500 (CDT)

Thanks!

I must confess I am just a beginner, but I followed your suggestion and did 'm <- lm(as.matrix(snp[, -1]) ~ lat, data = snp) ' and it worked perfectly. I would like to understand what is being done here. as.matrix I understand makes my data frame be a matrix, but I don't understand the part snp[,-1]. I think I am saying use all rows of... but I don't understand the -1, does that mean, all columns but column 1?

I really appreciate the help! It was really really valuable.

A related question is, what is m? If I do is.object(m) I get true. so I guess it is an object. I now need to use each of the fitted models for more things, such as calculate anova, etc... How do I do that? When I do this column by column I just do anova(m), but it does not seem to work now...

Thanks!
AG

--
View this message in context: http://r.789695.n4.nabble.com/automating-regression-or-correlations-for-many-variables-tp3426091p3426519.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Mon 04 Apr 2011 - 20:36:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Apr 2011 - 23:00:27 GMT.

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

list of date sections of archive