construct_interval_probs {ICSKAT} | R Documentation |
construct_interval_probs.R
Description
Construct the probabilities of falling into each time interval for bootstrapping of interval-censored data.
Usage
construct_interval_probs(
allTimes,
dmats,
nullBeta,
p,
nKnots,
infVal = 999,
zeroVal = 0
)
Arguments
allTimes |
n*s matrix where n is number of subjects and s is all visit times for that subjects. |
dmats |
Output from make_IC_dmats, a list holding left_dmat and right_dmat. |
nullBeta |
Vector of coefficients under the null model. |
p |
Number of covariates in the null model. |
nKnots |
Number of knots in the spline. |
infVal |
The numeric value representing time 0 (left-censored observation). |
zeroVal |
The numeric value representing time infinity (right-censored observation). |
Value
n*(s+1) matrix where element (i,j) holds the probability that subject i will fail in interval j.
Examples
set.seed(2)
xMat <- matrix(data=rnorm(200), nrow=100)
bhFunInv <- function(x) {x}
obsTimes <- 1:5
etaVec <- rep(0, 100)
outcomeDat <- gen_IC_data(bhFunInv = bhFunInv, obsTimes = obsTimes, windowHalf = 0.1,
probMiss = 0.1, etaVec = etaVec)
lt <- outcomeDat$leftTimes
rt <- outcomeDat$rightTimes
tpos_ind <- as.numeric(lt > 0)
obs_ind <- as.numeric(rt != Inf)
dmats <- make_IC_dmat(xMat, lt, rt, obs_ind, tpos_ind)
nullFit <- ICSKAT_fit_null(init_beta = rep(0, 5), left_dmat = dmats$left_dmat,
right_dmat=dmats$right_dmat, obs_ind = obs_ind, tpos_ind = tpos_ind,
lt = lt, rt = rt)
intervalProbOutput <- construct_interval_probs(allTimes = outcomeDat$allVisits,
dmats = dmats, nullBeta = nullFit$beta_fit, p = ncol(xMat), nKnots=1)
[Package ICSKAT version 0.2.0 Index]