R/fitted.opticut.R

## Note: zip2 and zinb2 returns correct fitted values based on bestmodel
## no need to tweak the sign etc.
fitted.opticut <-
function (object, ...)
{
    if (is.function(object$dist))
        stop("fitted values not available for custom distriutions")
    if (!.opticut_dist(object$dist))
        stop("distribution not recognized")
    fit <- sapply(bestmodel(object), fitted)
    rownames(fit) <- rownames(object$Y)
    fit
}

Try the opticut package in your browser

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

opticut documentation built on May 2, 2019, 5:09 a.m.