fn interp_lm(
args: &[RValue],
named: &[(String, RValue)],
_context: &BuiltinContext<'_>,
) -> Result<RValue, RError>Expand description
Fit a linear model using ordinary least squares.
Supports simple and multiple linear regression with formula syntax.
The formula y ~ x fits a simple regression; y ~ x1 + x2 fits
multiple regression. An intercept is always included.
@param formula a formula specifying the model (e.g. y ~ x) @param data a data frame containing the variables in the formula @return a list of class “lm” with components: coefficients, residuals, fitted.values, and call