powered by
Computes the ordinary least squares coefficients.
ols(X, Y, return_se = FALSE)
(list): A list containing the following:
(vector): p-vector of ordinary least squares estimates of the coefficients.
(vector): If return_se == TRUE, return the p-vector of standard errors of the coefficients.
(matrix): n x p matrix of covariates.
(vector): p-vector of outcome values.
(bool, optional): Whether to return the standard errors of the coefficients.
n <- 1000 X <- rnorm(n, 1, 1) Y <- X + rnorm(n, 0, 1) ols(X, Y, return_se = TRUE)
Run the code above in your browser using DataLab