\begin{Schunk}
\begin{Sinput}
 library(car)
 m1by <- by(Prestige, Prestige$type, function(x) {lm(prestige ~ education, data=x)})
 (lapply(m1by, summary))
\end{Sinput}
\begin{Soutput}
$bc

Call:
lm(formula = prestige ~ education, data = x)

Residuals:
     Min       1Q   Median       3Q      Max 
-19.7095  -6.0923   0.5828   6.4920  16.1411 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   -4.294      9.331  -0.460    0.648    
education      4.764      1.106   4.308 9.71e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 8.447 on 42 degrees of freedom
Multiple R-squared:  0.3064,	Adjusted R-squared:  0.2899 
F-statistic: 18.56 on 1 and 42 DF,  p-value: 9.709e-05


$prof

Call:
lm(formula = prestige ~ education, data = x)

Residuals:
     Min       1Q   Median       3Q      Max 
-13.8450  -4.1613   0.6782   4.8756  12.2557 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  14.5701    12.9892   1.122 0.271190    
education     3.7828     0.9179   4.121 0.000288 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 7.009 on 29 degrees of freedom
Multiple R-squared:  0.3693,	Adjusted R-squared:  0.3476 
F-statistic: 16.98 on 1 and 29 DF,  p-value: 0.0002876


$wc

Call:
lm(formula = prestige ~ education, data = x)

Residuals:
    Min      1Q  Median      3Q     Max 
-16.417  -3.509   1.081   4.865  13.879 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)   
(Intercept)  -28.677     19.428  -1.476  0.15477   
education      6.435      1.757   3.663  0.00145 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 7.608 on 21 degrees of freedom
Multiple R-squared:  0.3898,	Adjusted R-squared:  0.3607 
F-statistic: 13.41 on 1 and 21 DF,  p-value: 0.001451
\end{Soutput}
\end{Schunk}
