Peter Rooney
2005-Feb-17 18:26 UTC
[R] Newbie: How to produce lm results at sub-level within df
Hi, Given a data frame: df1: application id (appid), project id (pid), person months (pm), function points (fp) How do I produce linear modelling results at the appid level. That is, I would like to find the coefficent and intercept for the formula "pm ~ fp" for each application. Thanks
Chuck Cleland
2005-Feb-17 20:08 UTC
[R] Newbie: How to produce lm results at sub-level within df
?by by(df1, df1$appid, function(x) summary(lm(pm ~ fp, data=x))) Peter Rooney wrote:> Hi, > > Given a data frame: > > df1: application id (appid), project id (pid), person > months (pm), function points (fp) > > How do I produce linear modelling results at the appid > level. That is, I would like to find the coefficent > and intercept for the formula "pm ~ fp" for each > application.-- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894