fit {trending}R Documentation

Fit generic

Description

fit() is a generic to fit a specified model.

Usage

fit(x, data, ...)

## Default S3 method:
fit(x, data, ...)

Arguments

x

An R object

data

A data frame containing the data to fit.

...

Arguments passed to underlying methods.

Value

The value returned depends on the class of the input argument.

Author(s)

Tim Taylor

See Also

fit.trending_model() and fit.list()

Examples

x = rnorm(100, mean = 0)
y = rpois(n = 100, lambda = exp(1.5 + 0.5*x))
dat <- data.frame(x = x, y = y)

poisson_model <- glm_model(y ~ x , family = poisson)
negbin_model <- glm_nb_model(y ~ x)

fit(poisson_model, dat)
fit(negbin_model, dat)
fit(list(poisson_model, negbin_model), dat)
fit(list(pm = poisson_model, nm = negbin_model), dat)


[Package trending version 0.1.0 Index]