Skip to content
Prev 260498 / 398502 Next

regression coefficient for different factors

You have received suggestions about this already, but you may want to consider something like this as an alternative:
+                   rep=TRUE), levels = lev),
+                   B = rnorm(500))
+                 function(x) coef(lm(A ~ B, dat,
+                                     subset = f == x)))
(Intercept)        B
zero     1.967234 2.795218
one      1.864298 3.048861
two      1.978757 2.893950
three    2.035777 2.796963
four     2.092047 2.826677
five     2.263936 3.229843
six      1.740911 3.114069
seven    1.975918 3.090971
eight    2.064802 3.048225
nine     2.030697 3.059960
(Intercept)        B
zero     1.967234 2.795218
one      1.864298 3.048861
two      1.978757 2.893950
three    2.035777 2.796963
four     2.092047 2.826677
five     2.263936 3.229843
six      1.740911 3.114069
seven    1.975918 3.090971
eight    2.064802 3.048225
nine     2.030697 3.059960
Bill Venables