Description Usage Arguments Details Value See Also Examples
Plot a regression line for linear, orthogonal, local-polynomial, kernel, cubic smoothing spline, or GAM regressions.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | plot_lm(
x,
y,
col = "#00000040",
lcol = "#FF0000BF",
ci.col = "#ffd800",
cex = 0.8,
pch = 16,
xlab = NULL,
ylab = NULL,
args.func = list(),
interval = c("none", "confidence", "prediction"),
...
)
plot_ortho(
x,
y,
col = "#00000040",
lcol = "#FF0000BF",
cex = 0.8,
pch = 16,
xlab = NULL,
ylab = NULL,
args.func = list(),
...
)
plot_loess(
x,
y,
col = "#00000040",
lcol = "#FF0000BF",
cex = 0.8,
pch = 16,
xlab = NULL,
ylab = NULL,
args.func = list(),
...
)
plot_kernel(
x,
y,
col = "#00000040",
lcol = "#FF0000BF",
cex = 0.8,
pch = 16,
xlab = NULL,
ylab = NULL,
args.func = list(),
...
)
plot_spline(
x,
y,
col = "#00000040",
lcol = "#FF0000BF",
cex = 0.8,
pch = 16,
xlab = NULL,
ylab = NULL,
args.func = list(),
...
)
plot_gam(
x,
y,
col = "#00000040",
lcol = "#FF0000BF",
cex = 0.8,
pch = 16,
xlab = NULL,
ylab = NULL,
args.func = list(),
...
)
|
x, y |
vectors of x- and y-axis values. |
col |
vector of point colors. |
lcol |
vector of line colors. |
ci.col |
confidence interval color. |
cex |
numeric vector for scaling point size. |
pch |
a vector of plotting characters or symbols: see
|
xlab, ylab |
character strings for axis labels. |
args.func |
further arguments passed to the regression function. |
interval |
type of interval calculation, for linear model only. |
... |
further arguments passed to |
Plots a scatterplot with a regression line, useful for quick exploratory analysis.
A plot object.
lm
,
prcomp
,
loess
,
ksmooth
,
smooth.spline
, and
gam
for the underlying functions.
1 2 3 4 5 6 7 8 9 10 11 12 | set.seed(23)
n <- 55
x <- sin(1:n/pi)
y <- runif(n, 0, 0.75) + x
x[12] <- NA # handles NA
set_par(6)
plot_lm(x, y, main='Linear', interval='confidence')
plot_ortho(x, y, main='Orthogonal') # not identical to linear!
plot_loess(x, y, args.func=list(span=0.2), main='Loess')
plot_kernel(x, y, args.func=list(bandwidth=0.2), main='Kernel')
plot_spline(x, y, args.func=list(df=11), main='Spline')
plot_gam(x, y, args.func=list(gamma=0.5), main='GAM')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.