conf.p <- function(object) { if ("rootSolve" %in% rownames(installed.packages()) == FALSE) { print("rootSolve package required for the function to work") install.packages("rootSolve") } library(rootSolve) L.max <- object$L.max ci <- uniroot.all( function(p) ComPoissonDGLM( object$input$formula, object$input$dformula, object$input$data, object$input$exposure, object$input$numclaims, object$input$method,power = p,GSS = F )$L - L.max + qchisq(0.95,1) / 2,interval = object$power ) p.std <- sum(abs(object$power.max-ci))/2/qnorm(0.975) return(list(p.std=p.std,ci=ci)) }