calEquation: calculated slope and intercept from object of class lm

View source: R/add_lines.R

calEquationR Documentation

calculated slope and intercept from object of class lm

Description

calculated slope and intercept from object of class lm

Usage

calEquation(
  fit,
  mode = 1,
  pred = NULL,
  modx = NULL,
  modx.values = NULL,
  label = NULL,
  maxylev = 6,
  digits = 2
)

Arguments

fit

An object of class lm

mode

A numeric

pred

name of predictor variable

modx

name of modifier variable

modx.values

Numeric. Values of modifier variable

label

A character string

maxylev

maximum length of unique value of variable to be treated as a categorial variable

digits

Integer indicating the number of decimal places

Examples

fit=lm(mpg~wt*hp+carb,data=mtcars)
calEquation(fit)
calEquation(fit,pred="hp")

cardiomoon/predict3d documentation built on April 7, 2024, 10:26 p.m.