Functions called by other functions. Not to be directly called by user.
abmm(a1,b1,a2,b2)
kmgw.calc(time, status, keepCens = TRUE)
borkowf.calc(x, type = "log", alpha = 0.05, twosamp_output = FALSE)
kmConstrain(tstar, pstar, x, alpha = 0.05)
kmConstrainBeta.calc(tstar, pstar, x, alpha = 0.05)
create.kmciLR(x, all_times=NULL)
delta.calc(time_g,status_g, all_times=NULL,trans, method,
alpha,zero.one.adjustment,two_samp_out)
calc_sigma(S, V, dh)
kmciDelta(time,status,alpha=.05,
trans=c("none","log","cloglog","logodds","clog","loglog"),
zero.one.adjustment=FALSE,
method=c("standard","reg_hybrid",
"adj_hybrid","sh_adj_hybrid"),
all_times=NULL)
bpcp.mm(x,alpha=0.05)
bpcp.mc(x,nmc=100,alpha=0.05, testtime=0, DELTA=0, midp=FALSE)
bpcpMidp.mm(x,alpha=0.05, midptol=.Machine$double.eps^0.25)
kmcilog(x, alpha = 0.05)qqbeta(x, a, b)
rejectFromInt(theta,interval,thetaParm=FALSE)
uvab(u, v)
citoLR(x)
getmarks(time, status)
getmarks.x(x)
intChar(L, R, Lin = rep(FALSE, length(L)), Rin = rep(TRUE, length(L)),
digits = NULL)
meldMC(T1,T2, nullparm=NULL,
parmtype=c("difference","oddsratio","ratio","cdfratio","logsratio"),
conf.level=0.95,
alternative=c("two.sided","less","greater"),
dname="",estimate1=NA, estimate2=NA)
betaMeldTestMidp.mc(betaParms1,
betaParms2,nullparm=NULL,
parmtype=c("difference","oddsratio","ratio","cdfratio","logsratio"),
conf.level=0.95, conf.int=TRUE,
alternative=c("two.sided","less","greater"),
dname="",
estimate1=NA, estimate2=NA, nmc=10^6)
bpcpTesttime(x,time, status, group, fit1, fit2, check_args, midp,control,
controlMethod)
statusCheck(status)
parmtype_to_trans(parmtype)
twosampleChecks(time, testtime, status, group, alternative, parmtype, method,
nullparm, conf.level,changeGroupOrder, method_type=c("delta","bpcp"))
create.htest(testtime,alt,conf.level, lower, upper, p.value, est1, est2, beta,
nullparm, ptype, ug,method,zero.one.adjustment=FALSE)
create.twosamp(alt,conf.level, L, Lin, R, Rin, interval, g1, est_g1, lower_g1,
upper_g1, g2,est_g2, lower_g2, upper_g2,
beta, lower, upper,p.value,nullparm, ptype, method,
zero.one.adjustment=FALSE)
BtCI(x,tstar, ...)
calc_eqS1(S1Est, S2Est, h, phi, Za, S1primeEst, V1Est, S2primeEst, V2Est, dh)
calc_eqS2(method, VEst, VarHs=NULL, ShatStar=NULL, n=NULL)
zero.one.adjust(Shat1, Shat2, method,Shatprime_g1, Shatprime_g2, phi, h, Za,
VarEst_g1, VarHs_g1, VarEst_g2,VarHs_g2,
ShatStar_g1,ShatStar_g2,n1, n2,dh)
get_h(parmtype=NULL, trans=NULL)
get_dh(parmtype=NULL, trans=NULL)
get_hinv(trans)
get_g(parmtype)
get_ginv(parmtype)
get_all_times(time, status, cens_symbol=TRUE)
beta shape1 parameter
beta shape2 parameter
first beta shape1 parameter, first of two beta distributions
second beta shape1 parameter, second of two beta distributions
first beta shape2 parameter, first of two beta distributions
second beta shape2 parameter, second of two beta distributions
vector of means of beta distributions
vector of variances of beta distributions
time to event or censoring
vector of event status, 1 for events 0 for censoring
group for test, should have two levels, to change order use as factor and change order of levels
logical, keep times with only censored values?
output from kmgw.calc for one-sample functions, a class "twosamp" object for two-sample cases
either the parameter under the null (if thetaParm=TRUE) or an estimate of theta (if thetaParm=FALSE)
logical, is theta a parameter?
either a confidence interval (if thetaParm=TRUE) or quantiles from a null distribution (if thetaParm=FALSE);
for create.twosamp, it is the interval of survival and confidence intervals as determined by L, Lin, R, Rin
1-conf.level
time for test, needed for output for two-sample test
logical, do mid-p tests and/or confidence intervals?
tol value passed to uniroot in function
same at Delta in bpcp
time for survival distribution
null value for survival
character describing method, either 'log' transformation, 'logs' log transformation with shift, 'norm' no transformation, 'norms' no transformation with shift
number of Monte Carlo reps
left end of intervals associated with each surv and ci value
right end of intervals associated with each surv and ci value
logical vector, include left end in interval?
logical vector, include right end in interval?
how many significant digits to use
vector of nmc simulated values for parameter from group 1
vector of nmc simulated values for parameter from group 2
null value of the 2 sample parameter, when NULL gives values appropriate for parmtype
type of parameter for the two sample test, for details see bpcp2samp
type of parameter for the two sample test, for details see bpcp2samp
confidence level
logical, calculate confidence interval?
alternative hypothesis
alternative hypothesis
data name for 'htest' class of the result
estimate of parameter from group 1
estimate of parameter from group 1
estimate of parameter from group 2
estimate of parameter from group 2
named list of beta parameters from group 1 (usually come from method of moments), names: alower,blower, aupper, bupper
named list of beta parameters from group 2, names: alower,blower, aupper, bupper
logical, change the order of the groups?
type of two-sample CI, either "bpcp" or "delta"
CI method that depends on type, for bpcp is either "melded" or "midp", for delta is either "standard","reg_hybrid","adj_hybrid", or"sh_adj_hybrid", for details see delta2samp
p-value for the test
estimate of parameter determined by parmtype
the lower limit of the confidence interval for the parameter determined by parmtype
the upper limit of the confidence interval for the parameter determined by parmtype
character vector of two groups determined by changeGroupOrder, ug[1] will be group 1, and ug[2] will be group 2
default=FALSE, if true performs ad hoc modifications to the delta method when Kaplan-Meier estimators are 0 or 1.
transformation function of survival determined by parmtype
derivative function of h() determined by parmtype
Equal to 1 when h is an increasing function (transformation for s is none, log(s), or log(s/(1 . s))); and
equal to -1 when h is a decreasing function (transformation for s is log(1 . s) or log(.log(s))), in which cases the directions of the confidence interval are switched.
alpha level's z-score
estimates of group 1 survival as determined by method
estimates of group 1 survival used in h based on zero.one.adjustment
estimates of group 2 survival as determined by method
estimates of group 2 survival used in h based on zero.one.adjustment
estimates of group 1 variance, as determined by method
adjusted estimates of group 1 variance when VarEst_g1 = 0
estimates of group 2 variance, as determined by method
adjusted estimates of group 2 variance when VarEst_g2 = 0
estimates of group 1 survival used in sigma calculations, as determined by method and zero.one.adjustment
estimates of group 1 survival used in sigma calculations, as determined by method and zero.one.adjustment
estimates of group 2 survival used in sigma calculations, as determined by method and zero.one.adjustment
estimates of group 2 survival used in sigma calculations, as determined by method and zero.one.adjustment
variance estimates for a given group
adjusted hybrid variance estimates from Borkowf's method for a given group; only needed to adjust variance for borkowf's methods
shrunken estimates of survival from Borkowf's method for a given group; only needed to adjust variance for standard method
total number at risk at the start for a given group; only needed to adjust variance for standard method
adjusted hybrid variance estimates from Borkowf's method for group 1
adjusted hybrid variance estimates from Borkowf's method for group 2
shrunken estimates of survival from Borkowf's method for group 1
shrunken estimates of survival from Borkowf's method for group 2
total number at risk at the start for group 1
total number at risk at the start for group 2
one-sample survival transformation function, one of "none" (S), "log" (log(S)), "logodds" (log(S/(1-S)), "loglog" (log(-log(S))), "clog" (log(1-S)), or "cloglog" (log(-log(1-S)))
should a "+" be included for the times in which observations were censored?
kmciLRtidy output from bpcp for group 1
kmciLRtidy output from bpcp for group 2
list output from twosampleChecks with corrected parmtypes,lower and upper limits, nullparm, alternative hypothesis, group ordering, alpha and conf.level, one-sample transformation, and two-sample method
control settings, see bpcp2sampControl
either 'mm.mc' or 'mc.mc', see bpcp2sampControl
time to event or censoring for a given group
vector of event status, 1 for events 0 for censoring for a given group
is this being calculated for a two-sample CI?
estimates of survival
estimates of variance
whether borkowf.calc should return output needed for two-sample case (o/w one sample output)
Michael Fay
abmm uses method of moments to find a,b parameters from beta distribution that is product of two other beta RVs.
kmgw.calc calculates the Kaplan-Meier and Greenwood variances.
kmci.mid and kmci.cons calculate confidence intervals using a new method with either mid-p-like intervals or a conservative interval from input from kmgw.calc.
kmcilog gives normal approximation confidence interval using log transformation.
create.kmciLR creates kmciLR objects from kmgw.calc output.
borkowf.calc calculates the Borkowf intervals from output from kmgw.calc. kmciBorkowf creates a kmciLR object from the borkowf.calc output.
delta.calc runs borkowf's methods on a single sample and returns KM estimate, shrunken KM estimate, and 3 variance estimates (greenwood, regular hybrid, adjusted hybrid).
delta.calc is either called by kmciDelta in the one-sample case to create a kmciLR object, or delta2samp in the two-sample case to create either an htest or twosamp object.
calc_sigma calculates the variance estimate for h(S), which is asymptotically normal by the delta method.
bpcp.mm and bpcp.mc are the main calculation functions (.mm for method of moments, .mc for Monte Carlo simulation) for bpcp (repeated Beta method). Both output a list with two vectors, upper and lower. bpcpMidp.mm and bpcpMidp.mc are the mid-p versions of these functions.
kmConstrain gives constrained K-M estimate, and kmConstrainBeta.calc gives ci and tests using Beta distribution.
qqbeta is like qbeta, but allows a=0 (giving a value of 0 when b>0) and b=0 (giving a value of 1 when a>0).
rejectFromInt inputs theta and an interval and gives a vector with 3 terms, estGTnull=1 if reject and estimate is greater than null value, estLTnull=1 if reject and estimate is less than null value, two.sided=1 if reject in either direction. The thetaParm=TRUE means that theta is the parameter under the null so that interval is a confidence interval, while thetaParm=FALSE means that theta is an estimate of the parameter and interval are quantiles from the null distribution.
uvab takes means and variances of beta distributions and returns shape parameters.
statusCheck gives an error for vectors not all either 0 or 1
parmtype_to_trans returns the one-sample transformation (none, logodds, log, etc) based on the two-sample parmtype.
twosampleChecks runs argument checks for the two-sample functions, adjusts group ordering, and calculates lower/upper limit and nullparm based on the parmtype.
create.htest creates a list of class "htest" containing the two-sample results when the testtime is specified.
create.twosamp creates a list of class "twosamp" containing the two-sample results for the intervals corresponding to all distinct times in in the data.
BtCI pulls out beta estimate and CI for given test time(s) from a twosamp object.
calc_eqS1 calculates the 100(1-alpha)% confidence interval for the delta methods.
calc_eqS2 replaces variance estimates in the 0/1 survival case for the delta methods using Borkowf's adjusted hybrid variance for the three Borkowf methods, and with the shrunken survival estimates for the standard method.
zero.one.adjust finds replacements for beta estimates, lower and upper confidence intervals when survival estimates = 0 or 1. The need and type of adjustment needed depend on the parmtype and which Borkowf method is used.
get_h retrieves one-sample transformation function for survival, h(S); get_dh and get_hinv retrieve the derivative and the inverse of the transformation function, respectively. get_g retrieves the function to calculate the beta estimate from the difference D=h(S2)-h(S1). get_ginv retrieves the inverse of g(D) to find D from the beta estimate.
get_all_times creates a vector of all distinct event times across both groups to test for the twosamp class output of bpcp2samp and delta2samp.