Posts

Showing posts from July, 2019

Hetero What?

Image
Normality is the Great Neurosis of civilization. Tom Robbins, Normality is death. Theodor W. Adorno Consider the following data: It looks like there is a definite linear trend in the data, so a natural model might be \[{\mathbf{y}} = {\beta _0} + {\beta _1}{\mathbf{x}} + {\mathbf{\varepsilon }}\] The betas are numerical coefficients and ${\mathbf{\varepsilon }}$ represents an error term, i.e. the linear difference between the model values and the data values. Fitting a linear model to this sort of data is almost trivial in languages like R , Python , or Julia . In R: > fit.lm <- lm(y ~ x, df.lm$df) > summary(fit.lm) Call: lm(formula = y ~ x, data = df.lm$df) Residuals: Min 1Q Median 3Q Max -0.29382 -0.04390 -0.00026 0.03665 0.39976 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.1046755 0.0052070 20.10 <2e-16 *** x 0.0247682 0.0003006 82.41 <2e-16 *** --- Signi...