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 \hat h_x(t)
. The confidence bands are based on a wild bootstrap approach {h^*}_{{x_*},B}(t)
.
Pointwise:
For a given t\in (0,T)
generate {h^*}_{{x_*},B}^{(1)}(t),...,{h^*}_{{x_*},B}^{(N)}(t)
for N = 1000
and order it {h^*}_{{x_*},B}^{[1]}(t)\leq ...\leq {h^*}_{{x_*},B}^{[N]}(t)
. Then
\hat{I}^1_{n,N} = \Bigg[\hat{h}_{x_*}(t) - \hat{\sigma}_{{G}_{x_*}}(t)\frac{{h^*}_{{x_*},B}^{[ N(1-\frac{\alpha}{2})]}(t)}{\sqrt{n}}, \hat{h}_{x_*}(t) - \hat{\sigma}_{ {G}_x}(t)\frac{{h^*}_{{x_*},B}^{[ N\frac{\alpha}{2}]}(t)}{\sqrt{n}}\Bigg]
is a 1-\alpha
pointwise confidence band for h_{x_*}(t)
, where \hat{\sigma}_{{G}_{x_*}}(t)
is a bootrap estimate of the variance. For more details on the wild bootstrap approach, please see prep_boot
and g_xt
.
Uniform:
Generate \bar{h}_{{x_*},B}^{(1)}(t),...,\bar{h}_{{x_*},B}^{(N)}(t)
for N = 1000
for all t\in [\delta_T,T-\delta_T]
and define W^{(i)} = \sup_{t\in[0,T]}\big|\bar{h}_{{x_*},B}^{(i)}(t)|
for i = 1,...,N
. Order W^{[1]} \leq ... \leq W^{[N]}
. Then
\hat{I}^2_{n,N} = \Bigg[\hat{h}_{x_*}(t) \pm \hat{\sigma}_{{G}_{x_*}}(t) \frac{W^{[ N(1 - \alpha)]}}{\sqrt{n}} \Bigg]
is a 1-\alpha
uniform confidence band for h_{x_*}(t)
.
Value
A list with pointwise, uniform confidence bands and the estimator \hat h_x(t)
for all possible time points t
.
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")