All -
Not sure if this is a real programming question, but here goes:
I have data that looks like
Lake Length Weight
1 158 45
1 179 70
1 200 125
1 202 150
1 206 145
1 209 165
1 210 140
1 215 175
1 216 152
1 220 150
1 221 165
...
where lake goes from 1 - 84 and the number of rows for each lake is variable
(but > ~20).
I'm trying to do two things: 1) build a simple linear model of the form
{lm(log10(Weight)~log10(Length)}
for every separate lake in the data set; 2) I'd like to save the intercepts and
slopes
from each of these linear regressions into a seperate data frame. Any ideas?
I think it would
probably require some kind of 'for' statement, but I'm just not that smart.
Thanks for your help,
SR
Steven H. Ranney
Graduate Research Assistant (Ph.D)
USGS Montana Cooperative Fishery Research Unit
Montana State University
PO Box 173460
Bozeman, MT 59717-3460
phone: (406) 994-6643
fax: (406) 994-7479
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.