In R: pf(x, v_1, v_2) gives \(P(F_{v_1,v_2}\leq x)\).

Example: What is the conclusion for the sound example? Use \(\alpha = 0.05\).

Summary:

\[ SST = SSTr + SSE\\ DF_{SST} = DF_{SST r} + DF_{SSE} = N − 1 \]

Source of Variation Sum of Squares Degrees of Freedom Mean Square F p-value
Treatment \(SST_r\) \(k-1\) \(MSTr\) \(F_{H_0}\)
Error \(SSE\) \(N − k\) \(MSE\)
Total \(SST\) \(N − 1\)

Example: The ANOVA table for the sound data is:

Source of Variation Sum of Squares Degree of Freedom Mean Square F p-value
Treatment 41.73 2 20.87 5.96 0.0159
Error 42 15-3=12 3.5
Total 83.73 15-1=14

Assumptions:

  1. The k samples are independent.

  2. The variances of the k populations are equal.

  3. The k populations are normally distributed (or$ n_i $ for all i)

In R:

score <- c(7,4,6,8,9,5,5,3,1,4,2,4,6,1,2)
group <- c(rep(1,5), rep(2,5), rep(3,5))
group
##  [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3
# aov is analysis of variance
fit <- aov(score ~ as.factor(group))
anova(fit)
## Analysis of Variance Table
## 
## Response: score
##                  Df Sum Sq Mean Sq F value  Pr(>F)  
## as.factor(group)  2 41.733  20.867  5.9619 0.01593 *
## Residuals        12 42.000   3.500                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# The as.factor is treatment, residuals is error

Example: Researchers recruited overweight subject’s and randomly assigned them to one of four popular diet plans: Atkins, Ornish, Weight Watchers, and Zone. Each subject’s weight loss was measured after one year.

Diet Sample Mean weight Loss (in pounds) n
Atkins 3.92 21
Ornish 6.56 20
Weight Watchers 4.59 26
Zone 4.88 26
  1. Fill in the empty cells of the ANOVA table.
Source of Variation Sum of Squares Degrees of Freedom Mean Square F p-value
Treatment 78 4-1=3 78/3=26 0.539
Error 4294 93-4=89 4294/89=48.25
Total 4372 93-1=92
  1. Tests whether the average weight losses for the four diets are different. Use \(\alpha = 0.10\).

Let \(\mu\) denote the average weight losses for the ith diet, \(i=1,2,3,4\)

\(H_0:\mu_1=\mu_2=\mu_3=\mu_4\)

\(H_a:\) at lease one of them is different

\[ F={26\over48.25}=0.539 \]

the p-value is

1-pf(0.539,3,89)
## [1] 0.6568001

We failed to reject \(H_0\) because we don’t have sufficient evidence of a difference in average weight loss for four is different.

We can only make type I error in the ANOVA test, type I error is our assumption is true, but we reject it, type II error is that our assumption is false, but we failed to reject it.

Simple Linear Regression

Simple linear regression allows us to investigate the relationship between two variables Y and X.

Goal: To describe how \(E(Y | X = x)\) varies as a function of x.

Example: The data set heights.txt (on Canvas) contains the heights (in inches) of 1375 mother/daughter pairs.

heights<-read.csv("./heights.txt",sep=" ")
head(heights)
##   Mheight Dheight
## 1    59.7    55.1
## 2    58.2    56.5
## 3    60.6    56.0
## 4    60.7    56.8
## 5    61.8    56.0
## 6    55.5    57.9

X is the daughter’s height, Y is the mother’s height.

Recall: We already have some tools for looking at relationships between two variables.

  1. Scatter plots

    plot(heights$Mheight, heights$Dheight, xlab="Mother’s Height", ylab="Daughter’s Height")

  2. Covariance =$ Cov(X, Y )$ and sample covariance = \(S_{X,Y}\)

    cov(heights$Mheight, heights$Dheight) 
    ## [1] 3.004806
  3. Correlation = Corr(X, Y ) and sample correlation = rX,Y

    cor(heights$Mheight, heights$Dheight)
    ## [1] 0.4907094

Regression Model

The simple linear regression model is

\[ Y = \alpha_1 + \beta_1 X + \epsilon \] The error variable ε:

  1. has a N(0, σ2 ε ) distribution

  2. \(Cov(X, \epsilon) = 0\)

  3. \(\sigma_\epsilon^2\) is the same for all values of x.

Results:

  1. \(E(Y | X = x) = \alpha_1 + \beta_1 x\)

\[ E(Y|X=x)=E(\alpha_1+\beta_1 x +\epsilon|x)=\alpha+\beta E(X|x)+E(\epsilon|x) \]

\(E(\epsilon|x)=0\)

  1. The distribution of \(Y | X = x\) is \(N(\alpha_1 + \beta_1 x, σ^2_\epsilon )\).

The Method of Least Squares

We will use least squares to estimate the parameters of the linear regression model. Let \((X_1, Y_1), . . . ,(X_n, Y_n)\) be a random bivariate sample from the population.

Make the distance of observed point and prediction line is as small as possible

\[ SSE = \sum_{i=1}^n(y_i-\hat y_i)^2=\sum_{i=1}^n(y_i-(\hat \alpha_1+\hat\beta_1x_i))^2=\sum_{i=1}^n \hat \epsilon_i^2 \]

These vertical distances are the estimated errors and are called residuals:

\[ \hat \epsilon _i=Y_i-\hat Y_i \]

Minimizing the SSE provides the estimates:

\[ \hat \beta_1={S_{X,Y}\over S_X^2},\hat\alpha_1=\bar Y-\hat\beta_1\bar X \]

To ensure the fitted line passed the overall mean point \((\bar X,\bar Y)\)

derivative is required for computing these values by hand… (minimizing the value means the derivative is zero)

We can also use the SSE to estimate \(\sigma_\epsilon^2\):

\[ S_\epsilon^2={SSE\over n-2} \]

\(n-2\) is the df of residual.

We can obtain these estimates using R.

model <- lm(Dheight~Mheight, data = heights)
model$coefficients
## (Intercept)     Mheight 
##   29.917437    0.541747
model$residuals
##            1            2            3            4            5            6 
## -7.159733372 -4.947112855 -6.747305683 -6.001480384 -7.397402096 -2.084395924 
##            7            8            9           10           11           12 
## -2.830221223 -3.088667039 -3.867889947 -3.859540545 -4.009636959 -5.159733372 
##           13           14           15           16           17           18 
## -4.180510464 -5.138956280 -5.430606878 -4.684781579 -5.551576798 -5.868275602 
##           19           20           21           22           23           24 
## -6.847498510 -7.314293728 -2.688667039 -2.042841740 -3.284588752 -2.159540545 
##           25           26           27           28           29           30 
## -3.772161062 -3.555462258 -3.443034568 -3.143034568 -3.080510464 -3.959733372 
##           31           32           33           34           35           36 
## -3.451383970 -3.738956280 -4.484781579 -6.981088947 -1.197016441 -2.030414051 
##           37           38           39           40           41           42 
## -1.330414051 -0.897016441 -2.363811660 -2.255462258 -1.938763453 -2.317986361 
##           43           44           45           46           47           48 
## -2.617986361 -1.592938154 -2.559733372 -2.280510464 -2.988859867 -2.143034568 
##           49           50           51           52           53           54 
## -3.213908074 -2.759733372 -2.505558671 -3.043034568 -2.343034568 -2.697209269 
##           55           56           57           58           59           60 
## -2.713908074 -3.013908074 -3.638956280 -3.909829786 -2.830606878 -2.793130982 
##           61           62           63           64           65           66 
## -3.422257476 -3.447305683 -3.501480384 -3.855655085 -3.122257476 -3.347305683 
##           67           68           69           70           71           72 
## -3.276432177 -3.726528591 -3.851576798 -3.918179188 -3.364004487 -3.889052694 
##           73           74           75           76           77           78 
## -3.889052694 -3.434877993 -3.726528591 -4.026528591 -4.276625004 -4.184974407 
##           79           80           81           82           83           84 
## -3.705751499 -5.101673211 -4.364197315 -5.389245522 -6.451962452  0.036381168 
##           85           86           87           88           89           90 
##  0.290555869 -0.088667039 -1.030414051 -0.384588752 -0.576239349 -0.305365844 
##           91           92           93           94           95           96 
## -0.651191143 -0.955462258 -1.326335763 -1.117986361 -0.838763453 -1.472161062 
##           97           98           99          100          101          102 
## -0.655462258 -0.938763453 -1.226335763 -1.201287556 -1.680510464 -1.305558671 
##          103          104          105          106          107          108 
## -2.313908074 -1.597209269 -1.188859867 -2.005558671 -1.343034568 -1.197209269 
##          109          110          111          112          113          114 
## -2.213908074 -2.368082775 -1.613908074 -1.288859867 -1.988859867 -1.959733372 
##          115          116          117          118          119          120 
## -1.934685166 -1.893130982 -2.030606878 -2.130606878 -1.522257476 -2.484781579 
##          121          122          123          124          125          126 
## -1.793130982 -1.738956280 -1.847305683 -2.801480384 -1.630606878 -2.247305683 
##          127          128          129          130          131          132 
## -2.030606878 -2.909829786 -2.701480384 -2.222257476 -2.322257476 -2.655655085 
##          133          134          135          136          137          138 
## -2.176432177 -2.209829786 -2.409829786 -2.772353890 -3.197402096 -2.372353890 
##          139          140          141          142          143          144 
## -3.451576798 -3.189052694 -2.897402096 -2.489052694 -2.764004487 -2.934877993 
##          145          146          147          148          149          150 
## -2.880703292 -2.551576798 -2.751576798 -2.918179188 -3.397402096 -3.297402096 
##          151          152          153          154          155          156 
## -3.189052694 -3.414100901 -3.122450303 -3.614100901 -2.659926200 -2.868275602 
##          157          158          159          160          161          162 
## -3.622450303 -2.759926200 -3.259926200 -3.839149108 -3.314100901 -2.859926200 
##          163          164          165          166          167          168 
## -2.914100901 -2.805751499 -3.584974407 -3.776625004 -3.314100901 -2.930799706 
##          169          170          171          172          173          174 
## -3.418372016 -4.210022614 -3.880896119 -3.872546717 -4.426721418 -4.055847912 
##          175          176          177          178          179          180 
## -3.618372016 -3.847498510 -4.110022614 -3.955847912 -3.347498510 -3.247498510 
##          181          182          183          184          185          186 
## -3.772546717 -3.755847912 -3.935070820 -3.635070820 -3.847498510 -3.635070820 
##          187          188          189          190          191          192 
## -4.343420223 -4.176817832 -4.522643131 -4.893516636 -5.318564843 -5.735263648 
##          193          194          195          196          197          198 
## -5.543613050 -6.535456475  0.619682363  0.632110053  0.440459455 -0.063811660 
##          199          200          201          202          203          204 
##  0.352887145 -0.092938154  0.082013639 -0.772161062 -0.726335763 -0.026335763 
##          205          206          207          208          209          210 
## -0.563811660 -0.668082775 -0.588859867 -0.513908074 -0.705558671 -0.680510464 
##          211          212          213          214          215          216 
## -1.368082775  0.019489536 -1.213908074 -0.568082775 -0.868082775 -0.080510464 
##          217          218          219          220          221          222 
## -0.751383970 -0.659733372 -0.651383970 -0.943034568 -0.888859867 -1.043034568 
##          223          224          225          226          227          228 
## -0.488859867 -1.022257476 -0.793130982 -1.201480384 -0.893130982 -1.476432177 
##          229          230          231          232          233          234 
## -1.230606878 -1.855655085 -1.293130982 -1.709829786 -0.793130982 -1.409829786 
##          235          236          237          238          239          240 
## -1.355655085 -1.909829786 -1.101480384 -1.493130982 -1.155655085 -1.530606878 
##          241          242          243          244          245          246 
## -1.655655085 -2.180703292 -1.851576798 -1.543227395 -1.497402096 -1.843227395 
##          247          248          249          250          251          252 
## -1.726528591 -1.164004487 -2.397402096 -2.243227395 -1.672353890 -1.589052694 
##          253          254          255          256          257          258 
## -1.851576798 -1.651576798 -1.526528591 -1.789052694 -2.034877993 -1.897402096 
##          259          260          261          262          263          264 
## -2.297402096 -1.564004487 -1.589052694 -1.526528591 -1.480703292 -1.626528591 
##          265          266          267          268          269          270 
## -1.118179188 -1.543227395 -1.918179188 -1.626528591 -1.772353890 -2.126528591 
##          271          272          273          274          275          276 
## -2.351576798 -1.543227395 -1.864004487 -1.918179188 -1.380703292 -2.122450303 
##          277          278          279          280          281          282 
## -2.839149108 -1.976625004 -2.459926200 -2.439149108 -2.139149108 -1.859926200 
##          283          284          285          286          287          288 
## -2.039149108 -2.059926200 -2.476625004 -2.139149108 -2.539149108 -2.668275602 
##          289          290          291          292          293          294 
## -2.368275602 -2.384974407 -2.184974407 -2.093323809 -2.322450303 -2.630799706 
##          295          296          297          298          299          300 
## -2.393323809 -1.976625004 -2.622450303 -2.059926200 -1.714100901 -2.622450303 
##          301          302          303          304          305          306 
## -2.693323809 -1.759926200 -3.210022614 -3.335070820 -2.735070820 -2.935070820 
##          307          308          309          310          311          312 
## -3.535070820 -2.672546717 -3.335070820 -2.618372016 -2.472546717 -3.326721418 
##          313          314          315          316          317          318 
## -3.155847912 -3.172546717 -2.864197315 -2.735070820 -2.526721418 -3.776817832 
##          319          320          321          322          323          324 
## -3.160119027 -2.889245522 -2.843420223 -3.343420223 -3.122643131 -3.351769625 
##          325          326          327          328          329          330 
## -3.243420223 -3.460119027 -3.864390142 -4.510215441 -3.939341935 -3.585167234 
##          331          332          333          334          335          336 
## -4.185167234 -4.218564843 -4.143613050 -4.097787751 -4.597787751  1.186284754 
##          337          338          339          340          341          342 
##  1.194634156  1.223760651  1.315411248  0.998712444  0.390363041  0.927838938 
##          343          344          345          346          347          348 
##  0.807061846  0.427838938  0.790363041  0.282013639  0.973664237  0.690363041 
##          349          350          351          352          353          354 
##  0.573664237  1.252887145  0.282013639 -0.268082775  0.486091926 -0.059733372 
##          355          356          357          358          359          360 
##  0.002790731  0.611140133  0.156965432  0.619489536  0.611140133 -0.059733372 
##          361          362          363          364          365          366 
##  0.048616030  0.194441329  0.219489536  0.202790731  0.348616030  0.156965432 
##          367          368          369          370          371          372 
##  0.419489536  0.586091926  0.086091926  0.602790731  0.286091926  0.015218421 
##          373          374          375          376          377          378 
## -0.093130982 -0.147305683  0.023567823 -0.130606878  0.223567823 -0.530606878 
##          379          380          381          382          383          384 
## -0.476432177 -0.801480384 -0.484781579 -0.009829786 -0.801480384 -0.555655085 
##          385          386          387          388          389          390 
##  0.006869018 -0.176432177 -0.230606878 -0.038956280  0.052694317 -0.538956280 
##          391          392          393          394          395          396 
##  0.161043720 -0.176432177  0.377742524 -0.393130982 -0.184781579 -0.047305683 
##          397          398          399          400          401          402 
##  0.069393122  0.006869018  0.061043720 -0.701480384 -0.347305683  0.023567823 
##          403          404          405          406          407          408 
##  0.177742524  0.477742524 -1.343227395 -1.397402096 -0.572353890 -0.489052694 
##          409          410          411          412          413          414 
## -0.834877993 -0.618179188 -0.951576798 -0.472353890 -0.643227395 -1.089052694 
##          415          416          417          418          419          420 
## -0.734877993 -0.472353890 -0.780703292 -0.818179188 -0.564004487 -1.026528591 
##          421          422          423          424          425          426 
## -1.189052694 -0.964004487 -1.243227395 -1.097402096 -0.443227395 -0.626528591 
##          427          428          429          430          431          432 
## -0.980703292 -0.918179188 -0.864004487 -0.626528591 -0.889052694 -0.651576798 
##          433          434          435          436          437          438 
## -0.564004487 -0.418179188 -1.051576798 -0.718179188 -1.243227395 -1.026528591 
##          439          440          441          442          443          444 
## -0.543227395 -1.205751499 -1.130799706 -1.359926200 -1.505751499 -1.276625004 
##          445          446          447          448          449          450 
## -1.030799706 -1.214100901 -1.193323809 -1.576625004 -1.093323809 -1.614100901 
##          451          452          453          454          455          456 
## -1.339149108 -0.814100901 -1.276625004 -1.322450303 -0.868275602 -0.959926200 
##          457          458          459          460          461          462 
## -1.584974407 -1.176625004 -1.622450303 -1.122450303 -1.193323809 -1.114100901 
##          463          464          465          466          467          468 
## -1.559926200 -1.893323809 -1.130799706 -1.030799706 -1.584974407 -1.259926200 
##          469          470          471          472          473          474 
## -1.168275602 -0.759926200 -1.793323809 -1.030799706 -0.984974407 -1.284974407 
##          475          476          477          478          479          480 
## -1.955847912 -1.826721418 -1.935070820 -1.347498510 -2.210022614 -2.335070820 
##          481          482          483          484          485          486 
## -1.972546717 -1.826721418 -1.980896119 -1.701673211 -2.001673211 -2.110022614 
##          487          488          489          490          491          492 
## -1.964197315 -1.947498510 -1.418372016 -1.526721418 -2.264197315 -2.372546717 
##          493          494          495          496          497          498 
## -1.980896119 -2.118372016 -2.218372016 -1.655847912 -1.547498510 -1.818372016 
##          499          500          501          502          503          504 
## -3.076817832 -2.805944326 -2.605944326 -2.151769625 -2.168468430 -2.360119027 
##          505          506          507          508          509          510 
## -2.922643131 -2.189245522 -1.689245522 -2.668468430 -2.705944326 -2.289245522 
##          511          512          513          514          515          516 
## -2.814293728 -2.639341935 -2.785167234 -2.485167234 -3.301866039 -3.164390142 
##          517          518          519          520          521          522 
## -2.610215441 -2.556040740 -2.601866039 -3.056040740 -3.185167234 -3.426914246 
##          523          524          525          526          527          528 
## -3.481088947 -3.306137154 -3.877010659  2.665507662  2.723760651  2.277935352 
##          529          530          531          532          533          534 
##  2.902983559  2.848808857  1.661236547  2.252887145  1.636188340  2.207061846 
##          535          536          537          538          539          540 
##  2.007061846  1.498712444  1.548616030  0.956965432  1.331917225  1.419489536 
##          541          542          543          544          545          546 
##  0.948616030  1.865314834  1.556965432  1.040266628  1.165314834  1.556965432 
##          547          548          549          550          551          552 
##  1.548616030  1.411140133  0.902790731  1.619489536  1.111140133  1.802790731 
##          553          554          555          556          557          558 
##  1.511140133  1.286091926  1.006869018  0.598519616  0.144344915  1.269393122 
##          559          560          561          562          563          564 
##  1.423567823  1.169393122  0.290170214  0.706869018  0.806869018  1.069393122 
##          565          566          567          568          569          570 
##  0.977742524  0.723567823  0.998519616  0.623567823  0.298519616  0.598519616 
##          571          572          573          574          575          576 
##  1.315218421  0.915218421  0.623567823  1.044344915  0.290170214  0.861043720 
##          577          578          579          580          581          582 
##  0.544344915  1.023567823  0.869393122  1.423567823  1.223567823  0.690170214 
##          583          584          585          586          587          588 
##  0.544344915 -0.251576798  0.127646110  0.081820812  0.365122007  0.210947306 
##          589          590          591          592          593          594 
## -0.018179188 -0.026528591  0.227646110  0.119296708  0.419296708  0.410947306 
##          595          596          597          598          599          600 
##  0.081820812 -0.051576798  0.256772605  0.035995513  0.081820812  0.102597904 
##          601          602          603          604          605          606 
##  0.827646110  0.581820812  0.373471409  0.681820812  0.627646110 -0.251576798 
##          607          608          609          610          611          612 
##  0.527646110  0.448423202 -0.018179188  0.527646110  0.065122007  0.473471409 
##          613          614          615          616          617          618 
##  0.781820812  0.073471409  0.319296708  0.248423202  0.935995513 -0.134877993 
##          619          620          621          622          623          624 
##  0.273471409  0.119296708  0.002597904  0.302597904  0.148423202  0.210947306 
##          625          626          627          628          629          630 
##  0.627646110 -0.784974407 -0.230799706 -0.268275602 -0.439149108 -0.459926200 
##          631          632          633          634          635          636 
## -0.493323809 -0.159926200  0.077549697 -0.776625004 -0.230799706  0.094248501 
##          637          638          639          640          641          642 
## -0.114100901  0.094248501 -0.239149108 -0.639149108  0.094248501 -0.105751499 
##          643          644          645          646          647          648 
##  0.085899099 -0.739149108 -0.459926200 -0.505751499 -0.576625004 -0.414100901 
##          649          650          651          652          653          654 
## -0.693323809 -0.884974407 -0.276625004 -0.384974407 -0.368275602 -0.405751499 
##          655          656          657          658          659          660 
## -0.530799706 -0.084974407 -0.305751499 -0.468275602  0.094248501 -0.076625004 
##          661          662          663          664          665          666 
## -0.993323809 -0.205751499 -0.093323809 -0.005751499 -0.193323809  0.085899099 
##          667          668          669          670          671          672 
## -0.514100901  0.194248501 -0.684974407 -0.059926200 -0.839149108 -0.818372016 
##          673          674          675          676          677          678 
## -1.010022614 -1.118372016 -0.980896119 -0.555847912 -0.664197315 -0.772546717 
##          679          680          681          682          683          684 
## -0.972546717 -1.126721418 -0.455847912 -0.872546717 -0.526721418 -1.126721418 
##          685          686          687          688          689          690 
## -1.047498510 -1.380896119 -0.310022614 -0.735070820 -0.872546717 -0.501673211 
##          691          692          693          694          695          696 
## -1.235070820 -0.980896119 -1.080896119 -0.655847912 -0.818372016 -1.172546717 
##          697          698          699          700          701          702 
## -1.110022614 -1.226721418 -0.401673211 -0.801673211 -1.326721418 -0.664197315 
##          703          704          705          706          707          708 
## -1.135070820 -1.110022614 -0.764197315 -1.543420223 -1.389245522 -1.422643131 
##          709          710          711          712          713          714 
## -1.768468430 -1.597594924 -1.560119027 -1.168468430 -1.560119027 -1.368468430 
##          715          716          717          718          719          720 
## -0.789245522 -1.576817832 -1.643420223 -1.976817832 -1.660119027 -1.189245522 
##          721          722          723          724          725          726 
## -1.543420223 -1.051769625 -1.343420223 -2.001866039 -2.130992533 -1.939341935 
##          727          728          729          730          731          732 
## -2.001866039 -1.330992533 -1.793516636 -2.056040740 -1.839341935 -1.530992533 
##          733          734          735          736          737          738 
## -1.764390142 -2.351962452 -2.335263648 -2.589438349 -2.335263648  3.177935352 
##          739          740          741          742          743          744 
##  3.940459455  3.007061846  2.598712444  2.873664237  3.182013639  2.356965432 
##          745          746          747          748          749          750 
##  2.548616030  2.486091926  2.565314834  2.056965432  2.640266628  1.498519616 
##          751          752          753          754          755          756 
##  1.298519616  1.490170214  1.398519616  1.561043720  2.223567823  2.069393122 
##          757          758          759          760          761          762 
##  2.115218421  1.598519616  1.690170214  1.461043720  1.898519616  1.606869018 
##          763          764          765          766          767          768 
##  1.952694317  2.377742524  1.915218421  1.361043720  2.077742524  1.290170214 
##          769          770          771          772          773          774 
##  2.006869018  1.498519616  1.915218421  1.998519616  2.206869018  1.110947306 
##          775          776          777          778          779          780 
##  1.335995513  0.956772605  1.610947306  0.810947306  1.356772605  0.710947306 
##          781          782          783          784          785          786 
##  1.610947306  1.202597904  1.002597904  1.573471409  0.656772605  1.727646110 
##          787          788          789          790          791          792 
##  1.835995513  1.502597904  1.156772605  1.227646110  1.465122007  1.835995513 
##          793          794          795          796          797          798 
##  1.619296708  1.735995513  1.456772605  1.335995513  1.665122007  1.573471409 
##          799          800          801          802          803          804 
##  1.235995513  1.381820812  1.481820812  1.202597904  1.419296708  0.965122007 
##          805          806          807          808          809          810 
##  0.548423202  0.869200294  0.485899099  0.306676191  0.206676191  0.469200294 
##          811          812          813          814          815          816 
##  0.331724398  0.106676191  0.660850892  0.269200294  0.785899099  0.260850892 
##          817          818          819          820          821          822 
##  0.640073800  0.169200294  1.240073800  0.469200294  0.785899099  0.785899099 
##          823          824          825          826          827          828 
##  0.715025593  0.060850892  0.506676191  0.694248501  0.831724398  0.469200294 
##          829          830          831          832          833          834 
##  0.706676191  0.706676191  0.223374996  0.640073800  0.685899099  0.769200294 
##          835          836          837          838          839          840 
##  0.423374996  1.177549697  0.060850892  0.915025593  0.460850892  0.731724398 
##          841          842          843          844          845          846 
##  0.823374996  0.623374996  0.740073800 -0.155847912  0.435802685 -0.164197315 
##          847          848          849          850          851          852 
##  0.219103881 -0.235070820  0.089977386  0.381627984  0.652501490  0.364929180 
##          853          854          855          856          857          858 
##  0.164929180 -0.280896119  0.244152088 -0.380896119  0.364929180  0.389977386 
##          859          860          861          862          863          864 
## -0.235070820  0.544152088 -0.072546717 -0.272546717  0.635802685 -0.026721418 
##          865          866          867          868          869          870 
## -0.047498510  0.581627984 -0.164197315  0.698326789 -0.101673211  0.444152088 
##          871          872          873          874          875          876 
## -0.080896119  0.344152088  0.289977386  0.373278582 -0.318372016 -0.126721418 
##          877          878          879          880          881          882 
## -0.235070820  0.473278582  0.581627984 -0.264197315  0.481627984  0.264929180 
##          883          884          885          886          887          888 
##  0.198326789 -0.260119027 -0.543420223 -0.543420223 -0.460119027 -0.868468430 
##          889          890          891          892          893          894 
## -0.314293728 -0.622643131 -0.868468430 -0.389245522 -0.543420223 -0.143420223 
##          895          896          897          898          899          900 
## -0.343420223  0.202405076 -0.051769625 -0.143420223 -0.822643131 -0.868468430 
##          901          902          903          904          905          906 
## -0.576817832 -0.822643131 -0.522643131 -0.697594924 -0.489245522 -0.822643131 
##          907          908          909          910          911          912 
## -0.376817832 -0.589245522 -0.760119027 -0.651769625 -0.089245522 -1.318564843 
##          913          914          915          916          917          918 
## -0.393516636 -1.410215441 -1.156040740 -0.930992533 -0.664390142 -0.710215441 
##          919          920          921          922          923          924 
## -1.001866039 -0.801866039 -1.301866039 -1.264390142 -0.493516636 -0.539341935 
##          925          926          927          928          929          930 
## -0.701866039 -0.847691338 -1.056040740 -1.085167234 -0.901866039 -1.147691338 
##          931          932          933          934          935          936 
## -1.251962452 -1.672739544 -1.535263648 -1.589438349 -1.931185360 -1.947884165 
##          937          938          939          940          941          942 
##  4.052887145  3.394441329  3.756965432  3.048616030  3.811140133  3.519489536 
##          943          944          945          946          947          948 
##  3.219489536  3.477742524  2.661043720  2.398519616  3.369393122  2.244344915 
##          949          950          951          952          953          954 
##  2.623567823  3.261043720  3.315218421  2.861043720  3.006869018  1.756772605 
##          955          956          957          958          959          960 
##  1.927646110  2.019296708  1.848423202  2.165122007  1.848423202  2.219296708 
##          961          962          963          964          965          966 
##  2.327646110  1.973471409  1.819296708  2.502597904  2.510947306  2.181820812 
##          967          968          969          970          971          972 
##  1.765122007  2.781820812  2.935995513  2.235995513  1.648423202  1.160850892 
##          973          974          975          976          977          978 
##  1.523374996  1.223374996  1.306676191  1.515025593  1.423374996  2.015025593 
##          979          980          981          982          983          984 
##  1.931724398  2.031724398  2.131724398  1.706676191  1.460850892  1.385899099 
##          985          986          987          988          989          990 
##  1.915025593  1.623374996  1.985899099  1.523374996  2.240073800  2.031724398 
##          991          992          993          994          995          996 
##  2.240073800  1.677549697  2.085899099  2.231724398  1.615025593  1.160850892 
##          997          998          999         1000         1001         1002 
##  1.694248501  1.606676191  1.631724398  1.698326789  0.619103881  1.064929180 
##         1003         1004         1005         1006         1007         1008 
##  1.489977386  1.135802685  1.535802685  0.619103881  1.435802685  0.973278582 
##         1009         1010         1011         1012         1013         1014 
##  1.435802685  1.164929180  1.244152088  0.973278582  1.419103881  0.764929180 
##         1015         1016         1017         1018         1019         1020 
##  0.989977386  0.664929180  1.281627984  0.981627984  1.198326789  1.498326789 
##         1021         1022         1023         1024         1025         1026 
##  1.019103881  1.027453283  1.144152088  1.281627984  1.089977386  0.464929180 
##         1027         1028         1029         1030         1031         1032 
##  1.064929180  1.035802685  1.381627984  0.889977386  1.044152088  0.973278582 
##         1033         1034         1035         1036         1037         1038 
##  1.152501490  1.152501490  0.656579777  0.885706272  0.931531570  0.410754478 
##         1039         1040         1041         1042         1043         1044 
##  1.102405076  0.885706272  0.685706272  0.823182168  0.885706272  0.277356869 
##         1045         1046         1047         1048         1049         1050 
##  0.556579777  1.156579777  0.431531570  0.985706272  0.723182168  0.731531570 
##         1051         1052         1053         1054         1055         1056 
##  0.477356869  0.331531570  0.277356869  1.094055674  0.477356869  0.456579777 
##         1057         1058         1059         1060         1061         1062 
##  0.948230375  0.523182168  1.110754478  0.748230375  0.443959260  0.360658065 
##         1063         1064         1065         1066         1067         1068 
##  0.260658065 -0.264390142 -0.064390142  0.098133961 -0.210215441 -0.110215441 
##         1069         1070         1071         1072         1073         1074 
## -0.239341935 -0.410215441  0.014832766 -0.356040740  0.043959260  0.443959260 
##         1075         1076         1077         1078         1079         1080 
##  0.469007467  0.098133961 -0.681088947 -0.560311855 -0.372739544 -0.672739544 
##         1081         1082         1083         1084         1085         1086 
## -0.272739544 -0.681088947 -0.489438349 -0.906137154 -0.560311855 -0.635263648 
##         1087         1088         1089         1090         1091         1092 
## -0.097787751  0.064736352 -1.393709464 -0.731185360 -1.402058866  5.236188340 
##         1093         1094         1095         1096         1097         1098 
##  4.256965432  4.819489536  4.586091926  4.215218421  3.990170214  4.323567823 
##         1099         1100         1101         1102         1103         1104 
##  3.915218421  3.961043720  3.198519616  3.190170214  3.290170214  4.044344915 
##         1105         1106         1107         1108         1109         1110 
##  3.552694317  3.027646110  3.835995513  3.335995513  3.102597904  3.119296708 
##         1111         1112         1113         1114         1115         1116 
##  2.756772605  3.402597904  2.710947306  2.865122007  3.435995513  3.273471409 
##         1117         1118         1119         1120         1121         1122 
##  3.148423202  3.481820812  3.556772605  3.248423202  2.615025593  3.085899099 
##         1123         1124         1125         1126         1127         1128 
##  2.794248501  2.223374996  2.660850892  3.031724398  3.185899099  2.931724398 
##         1129         1130         1131         1132         1133         1134 
##  2.940073800  2.469200294  2.740073800  3.177549697  3.031724398  2.885899099 
##         1135         1136         1137         1138         1139         1140 
##  2.306676191  2.115025593  3.140073800  2.560850892  2.615025593  2.369200294 
##         1141         1142         1143         1144         1145         1146 
##  2.885899099  2.515025593  2.406676191  1.719103881  2.498326789  2.198326789 
##         1147         1148         1149         1150         1151         1152 
##  2.273278582  2.252501490  1.681627984  2.381627984  1.919103881  1.827453283 
##         1153         1154         1155         1156         1157         1158 
##  1.719103881  1.464929180  1.835802685  2.189977386  2.298326789  2.364929180 
##         1159         1160         1161         1162         1163         1164 
##  2.273278582  1.952501490  2.144152088  1.919103881  2.481627984  1.464929180 
##         1165         1166         1167         1168         1169         1170 
##  1.989977386  2.119103881  2.435802685  1.889977386  1.681627984  2.852501490 
##         1171         1172         1173         1174         1175         1176 
##  2.281627984  1.573278582  1.877356869  0.977356869  0.977356869  1.785706272 
##         1177         1178         1179         1180         1181         1182 
##  1.456579777  1.956579777  1.948230375  1.494055674  1.248230375  1.794055674 
##         1183         1184         1185         1186         1187         1188 
##  1.777356869  1.402405076  1.685706272  2.002405076  1.285706272  1.194055674 
##         1189         1190         1191         1192         1193         1194 
##  1.885706272  1.602405076  1.948230375  1.494055674  1.023182168  1.756579777 
##         1195         1196         1197         1198         1199         1200 
##  0.789784559  0.869007467  1.235609858  0.852308662  0.781435157  1.143959260 
##         1201         1202         1203         1204         1205         1206 
##  1.114832766  0.760658065  1.181435157  1.406483364  1.314832766  1.135609858 
##         1207         1208         1209         1210         1211         1212 
##  1.314832766  1.014832766  1.660658065  0.598133961  0.293862846  0.348037548 
##         1213         1214         1215         1216         1217         1218 
##  0.673085754  0.164736352  0.548037548  0.302212249  0.448037548 -0.160311855 
##         1219         1220         1221         1222         1223         1224 
##  0.702212249  0.973085754  0.218911053  0.856386950  0.364736352  0.102212249 
##         1225         1226         1227         1228         1229         1230 
##  0.093862846  0.810561651 -0.377010659  0.377164042  0.097941134 -0.443805878 
##         1231         1232         1233         1234         1235         1236 
## -0.364582970  5.331917225  5.719489536  4.652694317  4.661043720  4.915218421 
##         1237         1238         1239         1240         1241         1242 
##  5.152694317  4.615218421  5.044344915  4.010947306  4.619296708  4.935995513 
##         1243         1244         1245         1246         1247         1248 
##  4.527646110  3.965122007  4.665122007  4.381820812  4.210947306  4.240073800 
##         1249         1250         1251         1252         1253         1254 
##  3.969200294  4.285899099  3.877549697  4.177549697  3.006676191  3.777549697 
##         1255         1256         1257         1258         1259         1260 
##  3.894248501  2.464929180  2.727453283  3.598326789  2.919103881  3.852501490 
##         1261         1262         1263         1264         1265         1266 
##  3.073278582  3.852501490  2.619103881  3.489977386  2.773278582  3.398326789 
##         1267         1268         1269         1270         1271         1272 
##  3.744152088  2.952501490  3.498326789  3.744152088  3.102405076  2.931531570 
##         1273         1274         1275         1276         1277         1278 
##  2.539880973  1.977356869  1.923182168  2.602405076  2.085706272  2.231531570 
##         1279         1280         1281         1282         1283         1284 
##  3.102405076  2.077356869  3.002405076  2.931531570  3.256579777  2.585706272 
##         1285         1286         1287         1288         1289         1290 
##  2.343959260  1.543959260  1.381435157  1.689784559  2.389784559  2.181435157 
##         1291         1292         1293         1294         1295         1296 
##  2.714832766  1.760658065  1.869007467  2.560658065  1.869007467  1.002212249 
##         1297         1298         1299         1300         1301         1302 
##  1.448037548  0.939688145  1.756386950  1.518911053  1.248037548  1.673085754 
##         1303         1304         1305         1306         1307         1308 
##  1.110561651  1.585513444  1.531338743  1.331338743  0.614639938  0.914639938 
##         1309         1310         1311         1312         1313         1314 
## -0.135456475 -0.102251694  4.548423202  4.702597904  4.931724398  4.969200294 
##         1315         1316         1317         1318         1319         1320 
##  4.815025593  4.923374996  4.915025593  5.185899099  4.244152088  4.635802685 
##         1321         1322         1323         1324         1325         1326 
##  3.844152088  4.198326789  4.473278582  4.644152088  3.594055674  3.931531570 
##         1327         1328         1329         1330         1331         1332 
##  3.877356869  3.131531570  3.077356869  3.106483364  3.169007467  3.289784559 
##         1333         1334         1335         1336         1337         1338 
##  3.135609858  3.260658065  2.843959260  2.727260456  2.448037548  2.439688145 
##         1339         1340         1341         1342         1343         1344 
##  2.285513444  1.914639938  2.477164042  2.114639938  2.252115835  1.272892927 
##         1345         1346         1347         1348         1349         1350 
##  0.268621812  6.085899099  5.198326789  5.189977386  5.010754478  4.494055674 
##         1351         1352         1353         1354         1355         1356 
##  5.202405076  4.423182168  4.494055674  4.560658065  3.981435157  4.352308662 
##         1357         1358         1359         1360         1361         1362 
##  3.318911053  3.627260456  3.310561651  2.552115835  2.672892927  1.576971214 
##         1363         1364         1365         1366         1367         1368 
##  7.123374996  6.235802685  5.823182168  4.002212249  4.477164042  3.460465237 
##         1369         1370         1371         1372         1373         1374 
##  3.881242329  2.831145916  2.747844720  6.469007467  5.564736352  2.726874801 
##         1375 
##  9.052501490
sum(model$residuals^2)/model$df.residual
## [1] 5.136167
# sum(model$residuals^2) is SSE, df.residual is n-2

Note: The least squares estimates are also the maximum likelihood estimates of the parameters.

Interpretation

  • The estimated intercept, \(\hat\alpha_1\), is the estimated average value of Y when X = 0.

Example: \(\hat\alpha_1=29.917\)

The estimated average height of women chose mothers heights are 0 inches is 29.917 inches.

  • The estimated slope, \(\hat \beta_1\), is the estimated change in the average of \(Y | X = x\) for a one-unit increase in x.

Example: \(\hat \beta_1=0.542\)

The Mothers who are 1 inch taller have daughter who have 5.42 inches on average.