Rafael Xavier de Camargo
2011-May-23 16:04 UTC
[R] Linear regression - several response variables vs few ind variables
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
RAFAEL CAMARGO
2011-May-23 16:20 UTC
[R] Linear regression - several response variables vs few ind variables
Hi Everyone, 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@uottawa.ca rafael.x.camargo@gmail.com [[alternative HTML version deleted]]
Filipe Leme Botelho
2011-May-31 16:03 UTC
[R] RES: Linear regression - several response variables vs few indvariables
An embedded message was scrubbed... From: "Filipe Leme Botelho" <filipe.botelho at vpar.com.br> Subject: RES: [R] Linear regression - several response variables vs few indvariables Date: Tue, 31 May 2011 13:03:06 -0300 Size: 4359 URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110531/f32c3784/attachment.mht> -------------- next part -------------- "This message and its attachments may contain confidential and/or privileged information. If you are not the addressee, please, advise the sender immediately by replying to the e-mail and delete this message." "Este mensaje y sus anexos pueden contener informaci?n confidencial o privilegiada. Si ha recibido este e-mail por error por favor b?rrelo y env?e un mensaje al remitente." "Esta mensagem e seus anexos podem conter informa??o confidencial ou privilegiada. Caso n?o seja o destinat?rio, solicitamos a imediata notifica??o ao remetente e exclus?o da mensagem."