The function conduct the very common OLS estimation, which minimizes the sum of squared residuals.
tidymod_lm_matrix(X, Y, ...)
X | is the covariate matrix, which contains all explanatory variables. Has to be a matrix or be convertible with as.matrix() |
---|---|
Y | is the explained variable. Has to be numeric or be convertible with as.numeric() |
A list is returned containing the following elements coefficients, standard errors, degrees of freedom, variance-covariance matrix, fitted values, residuals, data used in the regression, the call, the intercept and the formula
tidymod_lm_matrix(mtcars[,2:3], mtcars[,1])#> #> Call: #> tidymod_lm_matrix(X = mtcars[, 2:3], Y = mtcars[, 1]) #> #> Coefficients: #> cyl disp #> 7.04544 -0.10862