Compares empirical data to a normal distribution with the same mean and standard deviation.

PlotDistDensityNormal(
  frm,
  xvar,
  title,
  ...,
  adjust = 0.5,
  curve_color = "lightgray",
  normal_color = "blue",
  mean_color = "blue",
  sd_color = "darkgray"
)

Arguments

frm

data frame to get values from

xvar

name of the independent (input or model) column in frame

title

title to place on plot

...

no unnamed argument, added to force named binding of later arguments.

adjust

passed to geom_density; controls smoothness of density plot

curve_color

color for empirical density curve

normal_color

color for theoretical matching normal

mean_color

color of mean line

sd_color

color for 1-standard deviation lines (can be NULL)

Details

Plots the empirical density, the theoretical matching normal, the mean value, and plus/minus one standard deviation from the mean.

See also

Examples

set.seed(52523) d <- data.frame(wt=100*rnorm(100)) PlotDistDensityNormal(d,'wt','example')
# no sd lines PlotDistDensityNormal(d, 'wt', 'example', sd_color=NULL)