isotInterval: Returns analytical interval estimates, given...

View source: R/analIntervals.r

isotIntervalR Documentation

Returns analytical interval estimates, given isotonic-regression (centered or not) point estimates

Description

For confidence intervals at design points ($x$ values with obesrvations), this function calls intfun to do the work. In addition, CIs for any $x$ value are calculated using linear interpolation between design points (note that for CIR, this differs from the interpolation of point estimates which is carried out between shrinkage points, as explained in quickIsotone)

Usage

isotInterval(
  isotPoint,
  outx = isotPoint$output$x,
  conf = 0.9,
  intfun = morrisCI,
  ...
)

Arguments

isotPoint

The output of an estimation function such as cirPAVA with the option full=TRUE. Should be a list of 3 doseResponse objects named input, output, shrinkage.

outx

vector of x values for which estimates will be made. If NULL (default), this will be set to the set of unique values in isotPoint$x argument (or equivalently in y$x).

conf

numeric, the interval's confidence level as a fraction in (0,1). Default 0.9.

intfun

the function to be used for interval estimation. Default morrisCI (see help on that function for additional options).

...

additional arguments passed on to intfun

Value

a data frame with two variables ciLow, ciHigh containing the estimated lower and upper confidence bounds, respectively.

Note

All provided algorithm and formulae are for Binomial data only. For other data, write your own intfun, returning a two-column matrix. The interval estimation method is presented and discussed by Oron and Flournoy (2017).

Interval coverage for extreme percentiles with adaptive designs may be lacking: use adaptiveCurve=TRUE whenever the target is not 0.5. However, targeting the the 5th or 95th percentile will likely produce intervals with 10-15% under-coverage by with that option.

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 3, 258-267.

See Also

quickIsotone,quickInverse,morrisCI,

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))
# The experiment's goal is to find the 30th percentile
slow1=cirPAVA(dat,full=TRUE)
# Default interval (Morris+Wilson); same as you get by directly calling 'quickIsotone'
int1=isotInterval(slow1)
# Morris without Wilson; the 'narrower=FALSE' argument is passed on to 'morrisCI'
int1_0=isotInterval(slow1,narrower=FALSE)
# Wilson without Morris
int2=isotInterval(slow1,intfun=wilsonCI)
# Agresti=Coull (the often-used "plus 2")
int3=isotInterval(slow1,intfun=agcouCI)
# Jeffrys (Bayesian-inspired) is also available
int4=isotInterval(slow1,intfun=jeffCI)

### Showing the data and the intervals
par(mar=c(3,3,4,1),mgp=c(2,.5,0),tcl=-0.25)
plot(dat,ylim=c(0,0.65),refsize=4,las=1,main="Forward-Estimation CIs") # uses plot.doseResponse()

# The true response function; true target is where it crosses the y=0.3 line
lines(seq(0,7,0.1),pweibull(seq(0,7,0.1),shape=1.1615,scale=8.4839),col=4)

lines(int1$ciLow,lty=2,col=2,lwd=2) 
lines(int1$ciHigh,lty=2,col=2,lwd=2) 

lines(int1_0$ciLow,lty=2) 
lines(int1_0$ciHigh,lty=2) 

lines(int2$ciLow,lty=2,col=3) 
lines(int2$ciHigh,lty=2,col=3) 
# Plotting the remaining 2 is skipped, as they are very similar to Wilson.

# Note how the default (red) boundaries take the tighter of the two options everywhere, 
# except for one place (dose 1 upper bound) where they go even tighter thanks to monotonicity 
# enforcement. This can often happen when sample size is uneven; since bounds tend to be 
# conservative it is rather safe to do.

legend('topleft',pch=c(NA,'X',NA,NA,NA),lty=c(1,NA,2,2,2),col=c(4,1,2,1,3),lwd=c(1,1,2,1,1),legend
=c('True Curve','Observations','Morris+Wilson (default)','Morris only','Wilson only'),bty='n')


cir documentation built on April 27, 2023, 9:05 a.m.