mx_plot: Plot Components of Mixture Distribution

Description Usage Arguments Value Examples

View source: R/mx_plot.R

Description

Plot Components of Mixture Distribution

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mx_plot(
  obj,
  breaks,
  counts,
  disc = 0,
  ecoff.prob = 0.01,
  main = "Subpopulations",
  length.out = 200,
  ...
)

Arguments

obj

Object of class mxObj.

breaks

class boundaries

counts

frequency of observations

disc

disc diameter (defaults to zero)

ecoff.prob

probability threshold for the ecoff

main

main title of the plot

length.out

number of points used for plotting component densities

...

other arguments passed to hist

Value

ecoff value (normal quantile)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
breaks <- 0:28
counts <- c(36, 0, 2, 3, 4, 8, 9, 14, 10, 9, 3, 1, 1, 2,
            4, 8, 20, 45, 40, 54, 41, 22, 8, 3, 3, 0, 0,0)

observations <- unbin(breaks[-1], counts) # upper class boundaries

(comp <- mx_guess_components(observations, bw=2/3, mincut=0.9))

obj <- mxObj(comp, left="e")

obj2 <- mx_metafit(breaks, counts, obj)

mx_plot(obj2, breaks, counts, disc=5.5)

## simplification for fitted objects with save.data = TRUE
mx_plot(obj2, disc=5.5)

tpetzoldt/antibioticR documentation built on Sept. 25, 2021, 1:17 p.m.