View source: R/print_and_plot_results.R
| hist.BMRMM | R Documentation | 
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.
## S3 method for class 'BMRMM'
hist(
  x,
  comp = NULL,
  xlim = NULL,
  breaks = NULL,
  main = NULL,
  col = "gray",
  xlab = "Duration times",
  ylab = "Density",
  ...
)
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.  | 
An object of class histogram.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.