bothlines: Add regression lines to a plot

Description Usage Arguments Value Author(s) See Also Examples

View source: R/bothlines.R

Description

Add the regression lines of y on x AND x on y to the plot. Optionally add the line obtained by allowing errors in both variables (Deming regression).

Usage

1
bothlines(x, y, Dem = FALSE, sdr = 1, col = "black", ...)

Arguments

x

Numeric vector

y

Numeric vector

Dem

Logical. Should the Deming regression line be added too?

sdr

Numeric. The assumed ratio of standard deviations used in the Deming regression.

col

Colour of the lines. Can be a vector of up to 3 elements, one for each line.

...

Additional arguments passed on to abline, which does the actual plotting.

Value

None.

Author(s)

Bendix Carstensen, Steno Diabetes Center, http://BendixCarstensen.com

See Also

abline.

Examples

1
2
3
4
5
6
7
8
9
data( ox )
oxw <- to.wide(ox)
attach( oxw )
plot( CO, pulse )
abline(0,1)
bothlines( CO, pulse, Dem=TRUE, col=rainbow(3), lwd=2 )
plot( CO, pulse,pch=16 )
abline(0,1, col=gray(0.7), lwd=2)
bothlines( CO, pulse, Dem=TRUE, col=c(rep("transparent",2),"black"), lwd=2 )

MethComp documentation built on Jan. 20, 2020, 1:12 a.m.

Related to bothlines in MethComp...