Description Usage Arguments Value Author(s) References Examples
View source: R/plot_regression.R
Draw regression curve with smoothed error bars with Visually-Weighted Regression by Solomon M. Hsiang; see http://www.fight-entropy.com/2012/07/visually-weighted-regression.html The R is modified from Felix Schonbrodt's original code http://www.nicebread.de/ visually-weighted-watercolor-plots-new-variants-please-vote
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | plot_regression(
formula,
data,
B = 1000,
shade = TRUE,
shade.alpha = 0.1,
spag = FALSE,
mweight = TRUE,
show.lm = FALSE,
show.median = TRUE,
median.col = "white",
show.CI = FALSE,
method = loess,
slices = 200,
ylim = NULL,
quantize = "continuous",
show.points = TRUE,
color = NULL,
pointsize = NULL,
...
)
|
formula |
formula |
data |
data |
B |
number bootstrapped smoothers |
shade |
plot the shaded confidence region? |
shade.alpha |
shade.alpha: should the CI shading fade out at the edges? (by reducing alpha; 0=no alpha decrease, 0.1=medium alpha decrease, 0.5=strong alpha decrease) |
spag |
plot spaghetti lines? |
mweight |
visually weight the median smoother |
show.lm |
plot the linear regression line |
show.median |
show median smoother |
median.col |
median color |
show.CI |
should the 95% CI limits be plotted? |
method |
the fitting function for the spaghettis; default: loess |
slices |
number of slices in x and y direction for the shaded region. Higher numbers make a smoother plot, but takes longer to draw. I wouldn'T go beyond 500 |
ylim |
restrict range of the watercoloring |
quantize |
either 'continuous', or 'SD'. In the latter case, we get three color regions for 1, 2, and 3 SD (an idea of John Mashey) |
show.points |
Show points. |
color |
Point colors |
pointsize |
Point sizes |
... |
further parameters passed to the fitting function, in the case of loess, for example, 'span=.9', or 'family='symmetric” |
ggplot2 object
Based on the original version from F. Schonbrodt. Modified by Leo Lahti microbiome-admin@googlegroups.com
See citation('microbiome')
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.