# nimDiffOR: Variable margin functions In nivm: Noninferiority Tests with Variable Margins

## Description

For testing the alternative F2(t)< g(F1(t)). We give several built-in choices for the function g. All functions must be defined in terms of delta and q, where F1(t0)=q and t0 is defined implicitly, and delta = F2(t0) - g(F1(t0)).

## Usage

 ```1 2 3``` ```nimDiffOR(p, delta = 0.1, q = 0.2) nimOR(p, delta=0.1, q=0.2) nimDiff(p,delta=.1, q=NULL) ```

## Arguments

 `p` a vector of F1(t) values, where F1(t) is the proportion of control that failed by t. `q` the probability associated with the control quantile of interest, not used for calculations in `nimDiff` but needs to be in the call. `delta` the difference: F2(t0) - g(F1(t0))

## Details

The functions are defined in terms of `delta` and `q` so that the function can change as a function of `delta` and we can use the function to get confidence intervals for delta (defined in terms of q, since q=F1(t0) which defines t0).

Functions should handle vectors of F1(t) values, and the output is a vector of the same length. The results should be between 0 and 1.

The function `nimDiffOR` gives the minimum of the difference (defined by delta) or the odds ratio (defined in terms of q and delta) when delta>0, and the maximum when delta<0.

For plots of the functions see Fay and Follmann (2015).

## Value

a vector of values g(F1(t)).

## References

Fay, MP and Follmann DA (2015). Non-inferiority Tests for Anti-Infective Drugs using Control Quantiles. (unpublished manuscript).

`nicqTest`
 ```1 2 3 4 5 6 7 8``` ```## notice that the second values, F1(t)=0.20=q, ## all equal ## q+delta=0.30 nimDiff(c(1:9)/10) nimOR(c(1:9)/10) nimDiffOR(c(1:9)/10) ## for delta<0, take max of difference and odds ratio nimDiffOR(c(1:9)/10,delta=-.1) ```