powered by
Creates a probability density plot of y for each group of x
group.pdf( x, y, col = NULL, lty = NULL, lwd = NULL, lx = "topleft", ly = NULL, ... )
Plot of grouped PDF's
Numeric, character or factorial vector of grouping variable (must be same length as y)
Numeric vector (density variable)
Optional line colors (see par, col)
Optional line types (see par, lty)
Optional line widths (see par, lwd)
Position of legend (x coordinate or 'topright', 'topleft', 'bottomright', 'bottomleft')
Position of legend (y coordinate)
Additional arguments passed to plot
Jeffrey S. Evans <jeffrey_evans<at>tnc.org>
Simonoff, J. S. (1996). Smoothing Methods in Statistics. Springer-Verlag, New York.
y=dnorm(runif(100)) x=rep(c(1,2,3), length.out=length(y)) group.pdf(x=as.factor(x), y=y, main='Probability Density of y by group(x)', ylab='PDF', xlab='Y', lty=c(1,2,3))
Run the code above in your browser using DataLab