R/XY.function2.R

XY.function2 <-
function (a, b) 
{
    if (b == 1) {
        result = sum(a[, 1] * a[, 2] * (a[, 3] + 0.5))
    }
    else {
        if (b == 2) {
            result = sum((1 - a[, 1]) * (1 - a[, 2]) * (a[, 3] + 
                0.5))
        }
        else {
            if (b == 3) {
                result = sum(a[, 1] * (1 - a[, 2]) * (a[, 3] + 
                  0.5))
            }
            else {
                if (b == 4) {
                  result = sum((1 - a[, 1]) * a[, 2] * (a[, 3] + 
                    0.5))
                }
            }
        }
    }
    return(result)
}

Try the HSROC package in your browser

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

HSROC documentation built on Sept. 19, 2019, 9:05 a.m.