Simple Model: Prediction + Residual
By the end of today, you can:
lm() to build a simple model based on mean.predict() and resid() to evaluate the performance of a model.Assume we need to estimate the area of a circle:


Students’ Height:
Student’s Height:

min Q1 median Q3 max
59 63.5 65.5 68.1 76.5
mean sd n missing
65.94682 3.547939 157 0
Hands on Simulation of Simple Models
Predicting the next random selection from: \(2, 2, 2, 4, 6, 12\)
| # | Guess | Actural | Match(0/1) | Actual-Guess |
|---|---|---|---|---|
| 1 | - | - | - | - |
| 2 | - | - | - | - |
\[\begin{array}{ll} - \text{Mode} & - \text{Median}\\ - \text{Mean} & - \text{Random Guess} \end{array}\]
Predicting the next random selection from: \(2, 2, 2, 4, 6, 12\)
Repeate 15-20 times:

min Q1 median Q3 max
2 2 3 5.5 11
mean sd n missing
4.5 3.563706 6 0
R functions:CourseKata Ch. 5