cirPAVA {cir} | R Documentation |
Returns centered-isotonic-regression estimate
Description
Nonparametric forward point estimation of a monotone response (y) as a function of dose (x), using the centered-isotonic-regression (CIR) algorithm.
Usage
cirPAVA(
y,
x = NULL,
wt = NULL,
outx = NULL,
full = FALSE,
dec = FALSE,
strict = FALSE,
interiorStrict = TRUE,
ybounds = 0:1,
adaptiveShrink = FALSE,
...
)
Arguments
y |
can be either of the following: y values (response rates), a |
x |
dose levels (if not included in y). |
wt |
weights (if not included in y). |
outx |
vector of x values for which predictions will be made. If |
full |
logical, is a more complete output desired? if |
dec |
logical, is the true function is assumed to be monotone decreasing? Default |
strict |
logical, should CIR enforce strict monotonicity by "fixing" flat intervals as well? Default |
interiorStrict |
logical, should CIR enforce strict monotonicity, but only for y values inside of |
ybounds |
numeric vector of length 2, relevant only under the default setting of |
adaptiveShrink |
logical, should the y-values be pre-shrunk towards an experiment's target? Recommended if data were obtained via an adaptive dose-finding design. If |
... |
Other arguments passed on to pre-processing functions. |
Details
This is the underlying "engine" function implementing CIR. For a quick and somewhat more user-friendly wrapper, use quickIsotone
. CIR is a variation of isotonic regression (IR) that shrinks IR's constant ("flat") intervals to single points and interpolates between these points, generating a curve that is strictly monotone everywhere except (possibly) near the boundaries.
Flat intervals in the raw input data, are handled with care. Under the default setting (strict=FALSE,interiorStrict=TRUE
), flat intervals are treated as monotonicity violations, unless the y
value is on the boundary of its allowed range (default [0,1]
, appropriate for binary-response data). On that boundary, flat intervals are left unchanged.
The algorithm is documented and discussed in Oron and Flournoy (2017). The function now include an adaptiveShrink
option, to mitigate bias caused when using adaptive designs (Flournoy and Oron, 2020).
Value
under default, returns a vector of y estimates at unique x values. With full=TRUE
, returns a list of 3 doseResponse
objects name output,input,shrinkage
for the output data at dose levels, the input data, and the function as fit at algorithm-generated shrinkage points, respectively.
Author(s)
Assaf P. Oron <assaf.oron.at.gmail.com>
References
Oron, A.P. and Flournoy, N., 2017. Centered Isotonic Regression: Point and Interval Estimation for Dose-Response Studies. Statistics in Biopharmaceutical Research 9, 258-267. (author's public version available on arxiv.org).
Flournoy, N. and Oron, A.P., 2020. Bias Induced by Adaptive Dose-Finding Designs. Journal of Applied Statistics 47, 2431-2442.
See Also
oldPAVA
,quickIsotone
; DRshrink
for explanation about adaptiveShrink
.
Examples
# Interesting run (#664) from a simulated up-and-down ensemble:
# (x will be auto-generated as dose levels 1:5)
dat=doseResponse(y=c(1/7,1/8,1/2,1/4,4/17),wt=c(7,24,20,12,17))
# CIR, using the default 'quick' function that also provides CIs (default 90%).
# The experiment's goal is to find the 30th percentile. We deploy the empirical bias correction.
quick1=quickIsotone(dat, adaptiveShrink = TRUE, adaptiveCurve = TRUE, target = 0.3)
quick1
# Use 'estfun' argument to operate the same function with old PAVA as the estimator
# Here we neglect the bias correction to sharpen the old:new contrast
quick0=quickIsotone(dat,estfun=oldPAVA)
quick0
### Showing the data and the fits
par(mar=c(3,3,1,1),mgp=c(2,.5,0),tcl=-0.25)
plot(dat, ylim=c(0.05,0.55), las=1) # uses plot.doseResponse()
# The IR fit: a straightforward interpolation
lines(quick0$y,lty=2)
# With CIR, 'quickIsotone' cannot show us the true underlying interpolation;
# it only provides the estimates at requested points. Interpolation should be done between
# shrinkage points, not the original design points. So we must call the full 'cirPAVA' function:
slow1 = cirPAVA(dat, full=TRUE, adaptiveShrink = TRUE, adaptiveCurve = TRUE, target = 0.3)
# Now, compare these 3 (the first one is wrong, b/c it interpolates from design points):
midpts = 1:4 + 0.5
approx(1:5,quick1$y, xout=midpts)$y
# instead, you can just call 'quickIsotone' and specify 'outx'
quickIsotone(dat,outx=midpts , adaptiveShrink = TRUE, adaptiveCurve = TRUE, target = 0.3)
approx(slow1$shrinkage$x,slow1$shrinkage$y,xout=midpts)$y # Or use 'cirPAVA'
# Ok... finally plotting the CIR curve
# Both flat intervals are shrunk, because neither are at y=0 or y=1
lines(slow1$shrinkage$x,slow1$shrinkage$y, lwd = 2)
# Last but not least, here's the true response function
lines(seq(1,5,0.1),pweibull(seq(1,5,0.1),shape=1.1615,scale=8.4839),col=2)
legend('topleft',pch=c(NA,'X',NA,NA),lty=c(1,NA,2,1),col=c(2,1,1,1),
legend=c('True Curve','Observations','IR','CIR'), bty='n')