xdc.plot.mx: Plot a Mixture

Description Usage Arguments Value

View source: R/xdc_viz.R

Description

Plotting a Gaussian mixture based on its parameter specifications (supporting an arbitrary number of mixture components)

Usage

1
xdc.plot.mx(mx, hist = c(), df = c(), mod = "", colors = c())

Arguments

mx,

the mixture specification in 3-col format, i.e., a data frame with three columns (mean, sd, weight)

hist,

optional, may be specified as the output of the xdc.hist.data function. If specified, the histogram of the data will be plotted as a dotted line. The x range of the histogram will also be used for the entire plot

df,

optional, will only be used if mod is also specified, so as to plot multiple lines for different subsets of data. df should be a data frame with at least two columns: es and si. It could also contain a column marking the moderator.

mod,

optional, could be a vector containing the moderator variable. Alternatively, it could specify a column or any expression over the columns in df

colors,

optional, specifying the colors used to plot the lines corresponding to the moderator levels. default to a few high-contrast colors followed by rainbow()

Value

displays a line chart with the PDF of the mixture distribution and, optionally, the histogram of the data


robustanalytics/xdc documentation built on Sept. 4, 2020, 12:37 a.m.