[R] linear regression in a data.frame using recast

Justin Haynes jtor14 at gmail.com
Wed Mar 16 20:19:11 CET 2011


I have a very large dataset with columns of id number, actual value,
predicted value.  This used to be a time series but I have dropped the
time component.  So I now have a data.frame where the id number is
repeated but each value in the actual and predicted columns are
unique.

I assume I need to use recast somehow but I'm at a loss... how can I
perform a simple linear regression (using lm()?) on my two variables
for each unique id number?

additionally, I need to fix the y-intercept at zero.


Thanks for your help,

Justin



More information about the R-help mailing list