Learn R Programming

WVPlots (version 1.1.1)

PlotDistHistBeta: Plot distribution details as a histogram plus matching beta

Description

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

Usage

PlotDistHistBeta(frm, xvar, title, ..., binwidth = NULL, bins = 30)

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

...

force later arguments to bind by name

binwidth

passed to geom_histogram(). If passed in, overrides bins.

bins

passed to geom_histogram(). Default: 30

Value

ggplot2 plot

Details

Plots the histogram of the empirical distribution and the density of the matching beta distribution. Also plots the mean and plus/minus one standard deviation.

The number of bins for the histogram defaults to 30. The binwidth can also be passed in instead of the number of bins.

Examples

Run this code
# NOT RUN {
set.seed(52523)
d <- data.frame(wt=rbeta(100,shape1=0.5,shape2=0.5))
PlotDistHistBeta(d,'wt','example')

# }

Run the code above in your browser using DataLab