modeled.hist: Return the theoretical value for the histogram bar

Description Usage Arguments Details Value Author(s) Examples

Description

Return the theoretical value for the histogram bar based on a model of distribution.

Usage

1
modeled.hist(breaks, FUN, ..., sum = 1)

Arguments

breaks

Vector with the breaks; it can be obtained directly from hist()

FUN

Function to be used to integrate the density, ex. pnorm

...

Parameters to be used by FUN

sum

Total numbers in the histogram; 1 for emperical frequencies

Details

modeled.hist returns the theoretical value for the histogram bar based on a model of distribution.

Value

A list with x (the center of the bar) and y components

Author(s)

Marc Girondot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
n <- rnorm(100, mean=10, sd=2)
breaks <- 0:20
hist(n, breaks=breaks)

s <- modeled.hist(breaks=breaks, FUN=pnorm, mean=10, sd=2, sum=100)

points(s$x, s$y, pch=19)
lines(s$x, s$y)

n <- rlnorm(100, meanlog=2, sdlog=0.4)
b <- hist(n, ylim=c(0, 70))

s <- modeled.hist(breaks=b$breaks, FUN=plnorm, meanlog=2, sdlog=0.4, sum=100)

points(s$x, s$y, pch=19)
lines(s$x, s$y)

## End(Not run)


Search within the HelpersMG package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.