R/confint.amh.R

Defines functions confint.amh

Documented in confint.amh

## File Name: confint.amh.R
## File Version: 0.091


#** confidence interval class amh
confint.amh <- function( object, parm, level=.95,  ... )
{
    mcmcobj <- object$mcmcobj
    exclude <- 'deviance'
    mcmcobj <- mcmcobj[, ! ( colnames(mcmcobj) %in% exclude ) ]
    if ( ! missing(parm) ){
        mcmcobj <- mcmcobj[,parm]
    }
    q1 <- ( 1 - level ) / 2
    h1 <- apply( mcmcobj, 2, stats::quantile, q1 )
    q2 <- 1 - ( 1 - level ) / 2
    h2 <- apply( mcmcobj, 2, stats::quantile, q2 )
    res <- data.frame( h1, h2)
    colnames(res)[1] <- paste0( round( 100*q1,1 ), ' %')
    colnames(res)[2] <- paste0( round( 100*q2,1 ), ' %')
    rownames(res) <- colnames(mcmcobj)
    return(res)
}

Try the LAM package in your browser

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

LAM documentation built on Sept. 11, 2024, 9:16 p.m.