[R] Linear regression - several response variables vs few ind variables

From: Rafael Xavier de Camargo <rcama081_at_uottawa.ca>
Date: Mon, 23 May 2011 12:04:39 -0400 (EDT)


Hi all,

I need to run several simple linear regressions at once, using the following data. Response variables: Bird species (sp 1, sp2, sp3...spn). Independent variable: Natprop - proportion of natural area. covarate: Effort = hours). One single linear regression would be: lmSp1 <- lm(sp1~ natprop + effort). However, I need to run this linear regression for all bird species that I have individually (n = 163). I would like to do it at once and store the coefficients in a single data frame. Is that possible?

Table that I have:
Square Sp1 Sp2 Sp3 Sp4 Spn Natprop Effort

1        1    0    1   1    0     0.5     10
2        1    0    1   1    0     0.6     20
3        1    1    0   1    0     0.8     23
4        1    0    1   0    0     0.8     50
n        0    1    0   1    1     0.9     30


Thanks in advance.

Rafael.



RAFAEL CAMARGO
Postgraduate Student
Biology Department of University of Ottawa 30 Marie Curie, room # 351
Ottawa, ON, CANADA
Tel: +1 (613) 562-5800 ext. 6366
Cel: +1 (613) 869-3772
e-mail: rcama081_at_uottawa.ca

        rafael.x.camargo_at_gmail.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 23 May 2011 - 17:38:33 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

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 Tue 31 May 2011 - 16:20:11 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