Math, Stats, Julia, Predictions, Linear Regression.
~ x), df)# Height~ Weight # create model MSE = deviance(model)/dof_residual(model) # calculate mean squared error pred(x) = coef(model)'*[1, x] # predict via coefficient A = [ones(n) df.x] # design matrix H = A*pinv(A) # hat matrix residuals = (I-H)*df.Y # residuals studentizedResiduals = residuals