hist.BMRMM {BMRMM} | R Documentation |
Histogram of Duration Times
Description
Plots the histogram of duration times in two ways as the users desire:
Histogram of all duration times superimposed the posterior mean mixture gamma distribution;
Histogram of a specified mixture component superimposed the gamma distribution with shape and rate parameters taken from the last MCMC iteration.
Usage
## S3 method for class 'BMRMM'
hist(
x,
comp = NULL,
xlim = NULL,
breaks = NULL,
main = NULL,
col = "gray",
xlab = "Duration times",
ylab = "Density",
...
)
Arguments
x |
an object of class |
comp |
one of
|
xlim |
a range of x values with sensible defaults. Default is |
breaks |
an integer giving the number of cells for the histogram. Default is |
main |
main title. Default is |
col |
color of the histogram bars. Default is |
xlab |
x-axis label. Default is |
ylab |
y-axis label. Default is |
... |
further arguments for the hist function. |
Value
An object of class histogram
.
Examples
results <- BMRMM(foxp2sm, num.cov = 2, simsize = 50,
duration.distr = list('mixgamma',shape=rep(1,3),rate=rep(1,3)))
# plot the histogram of all duration times superimposed with
# the posterior mixture gamma distribution
hist(results, xlim = c(0, 1), breaks = 50)
# plot the histogram for components 1 superimposed with
# the mixture gamma distribution of the last MCMC iteration
hist(results, components = 1)