#' @title A Dog Function
#'
#' @description This function allows you to express your love for the superior furry animal.
#' @param agree Do you agree dogs are the best pet? Defaults to TRUE.
#' @keywords dogs
#' @export
#' @examples
#' dogs_over_cats()
dogs_over_cats <- function(agree=TRUE){
if(agree==TRUE){
print("Woof woof!")
}
else {
print("Try again.")
}
}
#' @title calculate p-value for the AUC statistics
#'
#' @description Calcualte p-value for the AUC statistics corresponding to null hypothesis AUC == 0
#' @param predictions predicted values
#' @param labels true values
#' @keywords p values, statisticall signifficance, auc
#' @export
#' @examples
#' p_val_auc(c(0.3, 0.4, 0.6, 0.7), c(0, 0, 1, 1))
p_val_auc <- function(predictions, labels){
# assert_values_only(labels, c(0,1))
# if all the predictions are same, just return p-value of 1 directly
# if (all_the_same(predictions)){
# return(1)
# }
wilcox <- wilcox.test(predictions ~ labels, alternative='less')
wilcox$p.value
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.