Showing 1 of 10 files from the diff.
Other files ignored by Codecov

@@ -492,12 +492,37 @@
Loading
492 492
# Other input types (MCMCpack, ...) ---------------------------------------
493 493
494 494
495 -
#' #' @rdname mcmcRocPrc
496 -
#' #'
497 -
#' #' @export
498 -
#' mcmcRocPrc.bugs <- function(object, curves = FALSE, fullsims = FALSE, ...) {
499 -
#'   stop("not implemented yet")
500 -
#' }
495 +
496 +
#' @rdname mcmcRocPrc
497 +
#'
498 +
#' @export
499 +
mcmcRocPrc.bugs <- function(object, curves = FALSE, fullsims = FALSE, data,
500 +
                            xnames, yname, type = c("logit", "probit"), ...) {
501 +
  
502 +
  link_type <- match.arg(type)
503 +
  mdl_data <- data
504 +
  stopifnot(
505 +
    all(xnames %in% names(mdl_data)),
506 +
    all(yname %in% names(mdl_data))
507 +
  )
508 +
  
509 +
  # add intercept by default, maybe revisit this
510 +
  xdata <- as.matrix(cbind(X0 = 1L, as.data.frame(mdl_data[xnames])))
511 +
  yvec  <- mdl_data[[yname]]
512 +
  
513 +
  sm <- object$sims.matrix
514 +
  # Drop "deviance" column
515 +
  betadraws <- sm[, !colnames(sm) %in% "deviance"]
516 +
  
517 +
  if(link_type=="logit") {
518 +
    pred_prob <- plogis(xdata %*% t(betadraws))  
519 +
  } else if (link_type=="probit") {
520 +
    pred_prob <- pnorm(xdata %*% t(betadraws))
521 +
  } 
522 +
  
523 +
  new_mcmcRocPrc(pred_prob = pred_prob, yvec = yvec, curves = curves, 
524 +
                 fullsims = fullsims)
525 +
}
501 526
502 527
503 528
#' @rdname mcmcRocPrc
Files Coverage
R 83.17%
Project Totals (11 files) 83.17%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading