R/pvalfunc.R

Defines functions pvalfunc

pvalfunc <- function( x, y, test="normal"){

    if(is.function( test)){
        pval <- test(x,y)
    }else{
        if(test %in% c("ranks","ks")){
            if( test=="ranks"){
                pval <- 2*min( t.test(x,y)$p.value, var.test(x,y)$p.value)
            }else{
                pval <- ks.test(x,y)$p.value
            }
        }else{
            pval <- 2*min( t.test(x,y)$p.value, var.test(x,y)$p.value)
        }
    }
    return(pval)
}

Try the InvariantCausalPrediction package in your browser

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

InvariantCausalPrediction documentation built on Nov. 10, 2019, 5:06 p.m.