Learn R Programming

manymodelr (version 0.3.2)

fit_models: Fit several models with different response variables

Description

Fit several models with different response variables

Usage

fit_models(df = NULL, yname = NULL, xname = NULL, modeltype = NULL, ...)

Arguments

df

A data.frame object

yname

The outcome variable

xname

The predictor variable(s)

modeltype

A character specifying the model type e.g lm for linear model

...

Other arguments to specific model types.

Value

A list of model objects that can be used later.

Examples

Run this code
# NOT RUN {
fit_models(df=iris,yname=c("Sepal.Length","Sepal.Width"),
xname="Petal.Length + Petal.Width",modeltype="lm")

# }

Run the code above in your browser using DataLab