Skip to contents

Fit a linear model on the provided data.

Usage

# S3 method for InducerLm
fit(
  .inducer,
  .data,
  formula,
  subset,
  weights,
  na.action,
  method = "qr",
  model = TRUE,
  x = FALSE,
  y = FALSE,
  qr = TRUE,
  singular.ok = TRUE,
  offset,
  ...
)

Arguments

.inducer

An InducerLm object. The Inducer which should be used for the fitting.

.data

The data to which the model should be fitted, provided as a Dataset object.

formula

An object of class formula. An optional parameter setting the formula argument of an InducerLm object.

subset

An optional argument. A vector specifying a subset of observations that should be used for fitting the model.

weights

An optional argument. A vector of weights that should be used for fitting the model.

na.action

An optional argument. A function that specifies how to handle missing values.

method

The method which should be used for fitting. For more information see lm

model

if true model is returned

x

if true x is returned

y

if true y is returned

qr

if true the QR decomposition is returned

singular.ok

logical. If FALSE (the default in S but not in R) a singular fit is an error

offset

this can be used to specify an a priori known component to be included in the linear predictor during fitting.

...

further arguments

Value

An object of class ModelLm.

Examples

cars.data <- Dataset(data = cars, target = "dist")
inducer <- InducerLm()
lmfit <- fit.InducerLm(.inducer = inducer, .data = cars.data)
#> Error in fit.InducerLm(.inducer = inducer, .data = cars.data): could not find function "fit.InducerLm"