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 data.

event_time_name

The column name of the event times in the data frame data.

time_name

The column name of the times the marker values were observed in the data frame data.

event_name

The column name of the events in the data frame data.

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 h^x(t)\hat h_x(t). The confidence bands are based on a wild bootstrap approach hx,B(t){h^*}_{{x_*},B}(t).

Pointwise: For a given t(0,T)t\in (0,T) generate hx,B(1)(t),...,hx,B(N)(t){h^*}_{{x_*},B}^{(1)}(t),...,{h^*}_{{x_*},B}^{(N)}(t) for N=1000N = 1000 and order it hx,B[1](t)...hx,B[N](t){h^*}_{{x_*},B}^{[1]}(t)\leq ...\leq {h^*}_{{x_*},B}^{[N]}(t). Then

I^n,N1=[h^x(t)σ^Gx(t)hx,B[N(1α2)](t)n,h^x(t)σ^Gx(t)hx,B[Nα2](t)n] \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α1-\alpha pointwise confidence band for hx(t)h_{x_*}(t), where σ^Gx(t)\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 hˉx,B(1)(t),...,hˉx,B(N)(t)\bar{h}_{{x_*},B}^{(1)}(t),...,\bar{h}_{{x_*},B}^{(N)}(t) for N=1000N = 1000 for all t[δT,TδT]t\in [\delta_T,T-\delta_T] and define W(i)=supt[0,T]hˉx,B(i)(t)W^{(i)} = \sup_{t\in[0,T]}\big|\bar{h}_{{x_*},B}^{(i)}(t)| for i=1,...,Ni = 1,...,N. Order W[1]...W[N]W^{[1]} \leq ... \leq W^{[N]}. Then

I^n,N2=[h^x(t)±σ^Gx(t)W[N(1α)]n]\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α1-\alpha uniform confidence band for hx(t)h_{x_*}(t).

Value

A list with pointwise, uniform confidence bands and the estimator h^x(t)\hat h_x(t) for all possible time points tt.

See Also

g_xt, prep_boot

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")

[Package HQM version 0.1.0 Index]