Florian Oswald
2018-10-05
speed and stopping dist (ance):head(cars)
speed dist
1 4 2
2 4 10
3 7 4
4 7 22
5 8 16
6 9 10
speed and dist related?dist is increasing. :-(library(ScPoEconometrics) # load our library
launchApp('reg_simple_arrows')
aboutApp('reg_simple_arrows')
launchApp('reg_simple')
aboutApp('reg_simple')
How does OLS actually perform the minimization problem?
launchApp('SSR_cone')
aboutApp('SSR_cone') # after
Let's do some more OLS!
launchApp('reg_full')
aboutApp('reg_full') # after
launchApp('reg_constrained')
launchApp('demeaned_reg')
launchApp('reg_standardized')
x y y_hat error
1 0.00 2.09 2.57 -0.48
2 1.25 2.79 3.41 -0.62
3 2.50 6.49 4.25 2.24
4 3.75 1.71 5.10 -3.39
5 5.00 9.89 5.94 3.95
6 6.25 7.62 6.78 0.83
7 7.50 4.86 7.63 -2.77
8 8.75 7.38 8.47 -1.09
9 10.00 10.63 9.31 1.32
# 1.
all.equal(mean(ss$error), 0)
[1] TRUE
# 2.
all.equal(mean(ss$y_hat), mean(ss$y))
[1] TRUE
# 3.
all.equal(cov(ss$error,ss$y_hat), 0)
[1] TRUE
Francis Anscombe (1973) comes up with 4 datasets with identical stats. But look!
Dinosaurs?
launchApp("datasaurus")
aboutApp("datasaurus")
library(ScPoEconometrics)
launchApp('Rescale')
library(ScPoEconometrics)
runTutorial('rescaling')