Conf_bands {HQM} | R Documentation |
Confidence bands
Description
Implements the uniform and pointwise confidence bands for the future conditional hazard rate based on the last observed marker measure.
Usage
Conf_bands(data, marker_name, event_time_name = 'years',
time_name = 'year', event_name = 'status2', x, b)
Arguments
data |
A data frame of time dependent data points. Missing values are allowed. |
marker_name |
The column name of the marker values in the data frame |
event_time_name |
The column name of the event times in the data frame |
time_name |
The column name of the times the marker values were observed in the data frame |
event_name |
The column name of the events in the data frame |
x |
Numeric value of the last observed marker value. |
b |
Bandwidth. |
Details
The function Conf_bands
implements the pointwise and uniform confidence bands for the estimator of the future conditional hazard rate . The confidence bands are based on a wild bootstrap approach
.
Pointwise:
For a given generate
for
and order it
. Then
is a pointwise confidence band for
, where
is a bootrap estimate of the variance. For more details on the wild bootstrap approach, please see
prep_boot
and g_xt
.
Uniform:
Generate for
for all
and define
for
. Order
. Then
is a uniform confidence band for
.
Value
A list with pointwise, uniform confidence bands and the estimator for all possible time points
.
See Also
Examples
b = 10
x = 3
size_s_grid <- 100
s = pbc2$year
br_s = seq(0, max(s), max(s)/( size_s_grid-1))
c_bands = Conf_bands(pbc2, 'serBilir', event_time_name = 'years',
time_name = 'year', event_name = 'status2', x, b)
J = 60
plot(br_s[1:J], c_bands$h_hat[1:J], type = "l", ylim = c(0,1), ylab = 'Hazard', xlab = 'Years')
lines(br_s[1:J], c_bands$I_p_up[1:J], col = "red")
lines(br_s[1:J], c_bands$I_p_do[1:J], col = "red")
lines(br_s[1:J], c_bands$I_nu[1:J], col = "blue")
lines(br_s[1:J], c_bands$I_nd[1:J], col = "blue")