Closed jennywang0 closed 4 years ago
P-value calculations in conduct_ri aren't robust to specifications of a sharp hypothesis that are not zero
conduct_ri
summary.ri <- function(object, p = NULL, ...) { if(is.null(p)){p <- object$p} if (p == "two-tailed") { object$sims_df <- within( object$sims_df, extreme <- abs(est_sim) >= abs(est_obs) ) } else if (p == "lower") { object$sims_df <- within( object$sims_df, extreme <- est_sim <= est_obs ) } else if (p == "upper") { object$sims_df <- within( object$sims_df, extreme <- est_sim >= est_obs ) } else { stop('p must be either "two-tailed" (the default), "lower", or "upper".') }
should be:
summary.ri <- function(object, p = NULL, ...) { if(is.null(p)){p <- object$p} if (p == "two-tailed") { object$sims_df <- within( object$sims_df, # Changed line: extreme <- abs(est_sim - sharp_hypothesis) >= abs(est_obs - sharp_hypothesis) ) } else if (p == "lower") { object$sims_df <- within( object$sims_df, extreme <- est_sim <= est_obs ) } else if (p == "upper") { object$sims_df <- within( object$sims_df, extreme <- est_sim >= est_obs ) } else { stop('p must be either "two-tailed" (the default), "lower", or "upper".') }
P-value calculations in
conduct_ri
aren't robust to specifications of a sharp hypothesis that are not zeroshould be: