R/lnrest.R

Defines functions lnrest

Documented in lnrest

lnrest <-
function(x, f)
{
    f <- as.factor(f)
    nx <- tapply(x, f, length)
    lx <- log(x)
    mlx <- tapply(lx,f,mean)
    varlx <- tapply(lx,f,var)*((nx-1)/nx)
    lmx <- mlx + 0.5 * varlx
    varlmx <- varlx/nx + (varlx^2)/(2*nx)
return(list(estimate=lmx, varest=varlmx, n=nx))}

Try the MCPAN package in your browser

Any scripts or data that you put into this service are public.

MCPAN documentation built on May 1, 2019, 8:04 p.m.