gen_IC_data {ICSKAT} | R Documentation |
gen_IC_data.R
Description
Generate interval-censored data under the proportional odds/PH model given a baseline hazard function and some information about observation times.
Usage
gen_IC_data(bhFunInv, obsTimes, windowHalf, etaVec, mod = "PH", probMiss = 0.1)
Arguments
bhFunInv |
A function, the inverse of the baseline hazard function. |
obsTimes |
Vector of the intended observation times. |
windowHalf |
The amount of time before or after the intended obsTimes that a visit might take place. |
etaVec |
n*1 linear predictor in either the proportional odds or proportional hzards model. |
mod |
Either "PH" to generate under PH model or "PO" to generate under PO model. |
probMiss |
The probability of missing any given visit. |
Value
A list with the elements:
obs_ind |
n*1 vector of whether the event was observed before last follow-up. |
tpos_ind |
n*1 vector of whether the event was observed after follow-up started (t>0). |
tVec |
Fisher information matrix for the fitted coefficients. |
leftTimes |
n*1 vector of left side of interval times. |
rightTimes |
n*1 vector of right side of interval times. |
tVec |
n*1 vector of exact event times. |
Examples
set.seed(0)
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)