R/mergeTwoResultSets.R

mergeTwoResultSets <- function(results, resultsGreater, resultsLess,
                               merge.d.alt = FALSE) {
        results[["probrej"]] <- resultsGreater[["probrej"]] + resultsLess[["probrej"]]
        results[["probrej"]] <- ifelse(results[["probrej"]] > 1,
                                       1, results[["probrej"]])

        results[["iterations.taken"]] <- max(resultsGreater[["iterations.taken"]],
                                             resultsLess[["iterations.taken"]])

        if(merge.d.alt == TRUE) {
            ## results[["theta"]] <- c(resultsGreater[["theta"]],
            ##                         resultsLess[["theta"]])
            ## results[["typeIIerror"]] <- c(resultsGreater[["typeIIerror"]],
            ##                               resultsLess[["typeIIerror"]])
            results[["d.alternative"]] <- c(resultsGreater[["d.alternative"]],
                                            1 - resultsLess[["d.alternative"]])
        }

        return(results)
}

Try the npExact package in your browser

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

npExact documentation built on May 2, 2019, 9:58 a.m.