# percentile.ml: Calculate ML Estimate of Xp and Confidence Limits In STAND: Statistical Analysis of Non-Detects

## Description

Calculate the ML estimate of Xp the 100pth percentile of the lognormal distribution, and the lower and upper 100*γ% confidence limits LX(`p`,γ) and UX(`p`,γ). The upper confidence limit is used to test the null hypothesis that the exposure profile is "unacceptable". If UX(`p`,γ) < L the null hypothesis is rejected and workplace is considered "safe" or the object/area is not contaminated. The Type I error is ≤ α = 1 - γ. The resulting interval (LX,UX) is an approximate 100*(2γ - 1) percent confidence interval for Xp.

## Usage

 `1` ```percentile.ml(dd, p = 0.95, gam = 0.95, dat = TRUE) ```

## Arguments

 `dd` An n by 2 matrix or data frame with x (exposure) variable in column 1, and det= 0 for non-detect or 1 for detect in column 2 `p` is probability for Xp the 100pth percentile. Default is 0.95 `gam` one-sided confidence level γ. Default is 0.95 `dat` if `dat` is `FALSE` then `dd` is a list from `lnorm.ml`. Default is `TRUE`

## Details

The point estimate of Yp = log(Xp) is μ + z σ where μ and σ are ML estimates and z is qnorm(p). The variance of the estimate is

var(μ + zσ ) = var(μ ) + Z^2p var (σ )+ 2z cov(μ ,σ)

The 100γ {\%} LCL and UCL for Xp are

LX(p,γ ) = exp[Yp- t(γ ,(m-1))var(Yp)^{1/2}],

UX(p,γ ) = exp[Yp + t(γ ,(m-1))var(Yp)^{1/2}].

The ML estimates of var(μ), var(σ), and cov(μ ,σ) are obtained from the ML variance-covariance matrix using `lnorm.ml`. The null hypothesis Ho: Xp ≥ Lp is rejected at the α = (1- γ ) significance level if the 100γ\% UCL for Xp < Lp (indicating the exposure profile is acceptable).

## Value

A LIST with components:

 `Xp` ML estimate of the pth percentile of lognormal distribution `Xp.LCL` 100*γ% lower confidence limit for Xp `Xp.UCL` 100*γ% upper confidence limit for Xp `p` probability for Xp the 100pth percentile. Default 0.95 `gam` one-sided confidence level γ. Default is 0.95

## Note

The UCL is also referred to as an upper tolerance limit(UTL), i.e., if p = 0.95 and gam = 0.99 then Xp.UCL is the UTL-95%-99%.

E. L. Frome

## References

Cohen, A. C. (1991), Truncated and Censored Samples, Marcel Decker, New York

Cox, D. R. and D. V. Hinkley (1979), Theoretical Statistics, Chapman and Hall, New York.

Frome, E. L. and Wambach, P. F. (2005), "Statistical Methods and Software for the Analysis of Occupational Exposure Data with Non-Detectable Values," ORNL/TM-2005/52,Oak Ridge National Laboratory, Oak Ridge, TN 37830. Available at: http://www.csm.ornl.gov/esh/aoed/ORNLTM2005-52.pdf

Help files for `lnorm.ml`,`efraction.ml`
 ```1 2 3``` ```data(beTWA) # calculate ML estimate of 95th percentile and CLs for Example 2 in ORNLTM2005-52 unlist(percentile.ml(beTWA,0.95,0.95)) ```