Learn R Programming

rfml (version 0.1.0)

ml.lm: Creates a simnple linear model

Description

Returns a simple linear regression model, a linear regression model with a single explanatory variable

Usage

ml.lm(form, mlDf)

Arguments

form
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.
mlDf
an ml.data.frame object

Details

The function eliminates all pairs for which either the first field or the second field is empty. After the elimination, if the length of the input is less than 2, the function returns the empty sequence. After the elimination, if the standard deviation of the independent variable is 0, the function returns a linear model with intercept = the mean of the dependent variable, coefficients = NaN and r-squared = NaN. After the elimination, if the standard deviation of the dependent variable is 0, the function returns a linear model with r-squared = NaN.