This function fits and compares several models (linear, quadratic, cubic, exponential, logarithmic, sigmoidal, power, logistic) to a given set of dependent and independent variables. It returns either a summary of the models with their R-squared values or predicted values based on the models.
A data frame. If predict is FALSE, returns a data frame with the R-squared values for each model. If predict is TRUE, returns a data frame with the original data and predicted values for each model.
Arguments
dep
A numeric vector representing the dependent variable.
ind
A numeric vector representing the independent variable.
predict
Logical. If TRUE, the function returns predicted values for each model. Defaults to FALSE.
steps
Numeric. The step size for generating x-values for predictions. Only used if predict is TRUE. Defaults to 0.01.