regression: Fast Regression Models

View source: R/regression.R

regressionR Documentation

Fast Regression Models

Description

Functions to do fast regression modelling. The functions return a tibble with statistics. Use plot() for an extensive model visualisation.

Usage

regression(x, ...)

## Default S3 method:
regression(x, y = NULL, type = "lm", family = stats::gaussian, ...)

## S3 method for class 'data.frame'
regression(x, var1, var2 = NULL, type = "lm", family = stats::gaussian, ...)

## S3 method for class 'certestats_reg'
plot(x, ...)

## S3 method for class 'certestats_reg'
autoplot(object, ...)

Arguments

x

vector of values, or a data.frame

...

arguments for lm() or glm()

y

vector of values, optional

type

type of function to use, can be "lm" or "glm"

family

only used for glm()

var1, var2

column to use of x, the var2 argument is optional

object

data to plot

Examples

runif(10) |> regression()

data.frame(x = 1:50, y = runif(50)) |>
  regression(x, y)

mrsa_from_blood_years <- c(0, 1, 0, 0, 2, 0, 1, 3, 1, 2, 3, 1, 2)
mrsa_from_blood_years |> plot()

mrsa_from_blood_years |> regression()

mrsa_from_blood_years |> regression() |> plot()

certe-medical-epidemiology/certestats documentation built on Nov. 9, 2024, 8:15 p.m.