DrawRegression: Plot a linear regression line

Description Usage Arguments Author(s) Examples

View source: R/DrawRegression.R

Description

Plot a regression line not using abline().

Usage

1
DrawRegression(x, lm.obj, ylog = FALSE, lty = 1, lwd = 2)

Arguments

x

vector. x values.

lm.obj

object of class lm containing the results of a linear regression

ylog

logical. Should the y values be logged?

lty

optional parameter for line type

lwd

optional parameter for line width

Author(s)

Kevin Middleton (middletonk@missouri.edu)

Examples

1
2
3
4
5
6
7
8
9
set.seed(5)
x <- rnorm(20)
y <- 2 * x + rnorm(20)
fm <- lm(y ~ x)
plot(x, y)
abline(fm)

plot(x, y)
DrawRegression(x, fm)

kmiddleton/kmmisc documentation built on Jan. 27, 2020, 7:55 a.m.