Calculating the probabilities of positive binary exposure status at a given time point using risk-set Weibull calibration models
Calculating the probabilities of positive binary exposure status at a given time point using risk-set Weibull calibration models
For a given time point, calculate the probability of positive exposure value for multiple observations (participants). The function uses the results of a Weibull calibration model fit, and given collected data on the history of the binary exposure for each participant.
CalcWeibullRSP(w, w.res, point, weib.params)
Arguments
w: A matrix of time points when measurements on the binary covariate were obtained.
w.res: A matrix of measurement results of the binary covariate. Each measurement corresponds to the time points in w
point: The time point at which the probabilities are estimated.
weib.params: A bivariate vector. Shape and scale parameters of the Weibull calibration model.
Returns
A vector of estimated probabilities of positive exposure status at time point.
Details
At its present form this function is identical to CalcWeibullCalibP. This is because the current version of the ICcalib package (Version 1.0.005), the user loop over the main event times. Then, at each event time point, the user should include the appropriate Weibull parameters as estimated by FitCalibWeibullRS.
Examples
# Simulate data setsim.data <- ICcalib:::SimCoxIntervalCensSingle(n.sample =200, lambda =0.1, alpha =0.25, beta0 = log(0.5), mu =0.2, n.points =2, weib.shape =1, weib.scale =2)case.times <- sim.data$obs.tm[sim.data$delta==1]# Fit Weibull risk-set calibration modelscalib.weib.params <- FitCalibWeibullRS(w = sim.data$w, w.res = sim.data$w.res, tm = sim.data$obs.tm, event = sim.data$delta)# Calculate the conditional probabilities of binary covariate=1 at time oneprobs <- CalcWeibullRSP(w = sim.data$w, w.res = sim.data$w.res, point =1, weib.params = calib.weib.params)summary(probs)## Not run:if(interactive()){#EXAMPLE1}## End(Not run)