Re: [R] linear regression "group by"

2008-04-16 Thread Michael Dewey
At 18:03 14/04/2008, Ryan Lauritsen wrote: >Hi all. I'm brand new to R. > >My dataset (stored in MySQL) is a list of weather stations in rows by >year with various weather variables in columns, for example: >STNID YEAR TEMP DEWP >station11990 54 50 >station11991 23 10

Re: [R] linear regression "group by"

2008-04-14 Thread Henrique Dallazuanna
Try: by(x, list(x$STNID), function(.x)lm(TEMP ~ DEWP, data = .x)) On Mon, Apr 14, 2008 at 2:03 PM, Ryan Lauritsen <[EMAIL PROTECTED]> wrote: > Hi all. I'm brand new to R. > > My dataset (stored in MySQL) is a list of weather stations in rows by > year with various weather variables in columns,

[R] linear regression "group by"

2008-04-14 Thread Ryan Lauritsen
Hi all. I'm brand new to R. My dataset (stored in MySQL) is a list of weather stations in rows by year with various weather variables in columns, for example: STNID YEAR TEMP DEWP station11990 54 50 station11991 23 10 station11992 34 18 station21990