Description Usage Arguments Value Note Warning Author(s) See Also Examples
Creates a plot of type "h"
of the probabilities of each
possible x
value of a beta binomial distribution where
the probabilities are calculated on the basis of parameters
estimated by the function mleBb()
. If obsd
is supplied it also superimposes/juxtaposes vertical lines
representing the observed proportions.
1 2 3 4 5 |
x |
An object of class |
... |
Not used. |
plot |
Logical scalar; should a plot be produced (or should the function simply return a data frame consisting of the relevant values)? |
col.fit |
The colour for the (vertical) lines corresponding to the “fitted” probabilities, i.e. the probabilities calculated from the fitted parameters. |
col.obsd |
The colour for the (vertical) lines corresponding to the
“observed” probabilities (proportions), i.e. the
probabilities calculated by tabulating the data (from which the
parameters were estimated. Ignored if |
tikx |
(Optional) vector of locations of the tick marks on the |
xlim |
A numeric vector of length 2 specifying the limits
of the |
ylim |
A numeric vector of length 2 specifying the limits
of the |
xlab |
A label for the x-axis; defaults to |
ylab |
A label for the y-axis; defaults to |
obsd |
The data set from which the parameters were estimated, i.e. from
which |
incr |
Numeric scalar; defaults to 0.1 if |
main |
A main title for the plot; defaults to the empty string. |
legPos |
A list with components |
A data frame with numeric columns x
, p
and
possibly po
. The x
column consists of the integers
from 0 to size
. The p
column consists of the
appropriate probabilities of the x
values, calculated by
dbetabinom()
from the rmutil
package. The po
column is present only if obsd
is supplied and consists
of the observed proportions. The value is returned invisibly.
A plot is produced as a side-effect if plot
is TRUE
.
This function calls plotBb()
to do the heavy lifting.
It is up to the user to make sure that the obsd
argument,
if specified, is indeed the data set from which the object x
was calculated.
Rolf Turner r.turner@auckland.ac.nz
1 2 3 4 5 6 7 8 9 10 11 12 | if(require(hmm.discnp)) {
xxx <- hmm.discnp::Downloads
fit <- mleBb(xxx,size=14)
plot(fit)
plot(fit,obsd=xxx)
plot(fit,obsd=xxx,legPos=list(x=3,y=0.25))
plot(fit,obsd=xxx,legPos=NULL) # No legend is plotted.
}
set.seed(42)
yyy <- rbinom(300,10,0.7)
fit <- mleBb(yyy,size=10)
plot(fit,obsd=yyy,legPos="topleft")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.