Description Usage Arguments Examples
This function plots shadows for any CONTINUOUS probability distribution
1 2 3 4 |
dist |
the distribution name as |
param |
is a list with the parameters of the distribution. |
a |
is the lower limit of the shadow area. |
b |
is the upper limit of the shadow area. |
type |
is used to define the shadow are, it could be |
col.shadow |
is the shadow color, by default is |
col.line |
is the color line for the density. |
lwd |
is the line width, a positive number, defaulting to 3. |
nbreaks |
is the number of divisions to plot the shadow, by default is 10000. |
ylab |
is the y label, by default is 'Density'. |
x |
it is nothing. |
... |
Arguments to be passed to methods, such as graphical parameters (see par). |
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 | # With normal distribution
shadow.dist(dist='dnorm', param=list(mean=0, sd=1),
a=0, b=1, type='middle', from=-3, to=3)
shadow.dist(dist='dnorm', param=list(mean=0, sd=1),
a=0, type='lower', from=-3, to=3)
shadow.dist(dist='dnorm', param=list(mean=0, sd=1),
b=1, type='upper', from=-3, to=3)
shadow.dist(dist='dnorm', param=list(mean=0, sd=1),
a=0, b=1, type='two', from=-3, to=3)
# With chi-square distribution
shadow.dist(dist='dchisq', param=list(df=2),
a=2, b=6, type='middle', from=0, to=10, col.shadow='pink')
# With t distribution
shadow.dist(dist='dt', param=list(df=2),
a=-2, b=2, type='middle', from=-5, to=5, col.shadow='tomato')
# With beta distribution
shadow.dist(dist='dbeta', param=list(shape1=2, shape2=5),
a=0.2, b=0.6, type='middle', nbreaks=3, main='nbreaks=3, opps!!!')
shadow.dist(dist='dbeta', param=list(shape1=2, shape2=5),
a=0.2, b=0.6, type='middle', nbreaks=20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.