addlnorm: addlnorm - estimates a log-normal distribution from output of...

Description Usage Arguments Value Examples

View source: R/cpueplots.R

Description

addlnorm - estiamtes a log-normal distribution from output of a histogram of a data set.

Usage

1
addlnorm(inhist, xdata, inc = 0.01)

Arguments

inhist

- is the output from a call to 'hist' (see examples)

xdata

- is the data that is being plotted in the histogram.

inc

- defaults to a value of 0.01; is the fine grain increment used to define the normal curve. The histogram will be coarse grained relative to this.

Value

a 4 x N matrix of x and y values to be used to plot the fitted normal probability density function.Combined with estiamtes of mean(log(indata)) and log(sd(indata))

Examples

1
2
3
4
egdata <- rlnorm(200,meanlog=0.075,sdlog=0.5)
outh <- hist(egdata,main="",col=2,breaks=seq(0,8,0.2))
ans <- addlnorm(outh,egdata)
lines(ans[,"x"],ans[,"y"],lwd=2,col=4)

haddonm/r4cpue documentation built on May 11, 2020, 1:31 a.m.