h_xt {HQM} | R Documentation |
Future conditional hazard rate
Description
Calculates the future conditional hazard rate for a marker value x
and a time value t
.
Usage
h_xt(br_X, br_s, int_X, size_s_grid, alpha, x,t, b, Yi,n)
Arguments
br_X |
Vector of grid points for the marker values |
br_s |
Vector of grid points for the time values |
int_X |
Position of the linear interpolated marker values on the marker grid. |
size_s_grid |
Size of the time grid. |
alpha |
Marker-hazard obtained from |
x |
Numeric value of the last observed marker value. |
t |
Numeric time value. |
b |
Bandwidth. |
Yi |
A matrix made by |
n |
Number of individuals. |
Details
The function h_xt
implements the future conditional hazard estimator
where is the marker,
is the exposure and
is the marker-only hazard, see
get_alpha
for more details. The future conditional hazard is defined as
where is the survival time and
the marker of individual
observed in the time frame
.
Value
A single numeric value of .
See Also
Examples
pbc2_id = to_id(pbc2)
size_s_grid <- size_X_grid <- 100
n = max(as.numeric(pbc2$id))
s = pbc2$year
X = pbc2$serBilir
XX = pbc2_id$serBilir
ss <- pbc2_id$years
delta <- pbc2_id$status2
br_s = seq(0, max(s), max(s)/( size_s_grid-1))
br_X = seq(min(X), max(X), (max(X)-min(X))/( size_X_grid-1))
X_lin = lin_interpolate(br_s, pbc2_id$id, pbc2$id, X, s)
int_X <- findInterval(X_lin, br_X)
int_s = rep(1:length(br_s), n)
N <- make_N(pbc2, pbc2_id, breaks_X=br_X, breaks_s=br_s, ss, XX, delta)
Y <- make_Y(pbc2, pbc2_id, X_lin, br_X, br_s, size_s_grid, size_X_grid, int_s, int_X, 'years', n)
b = 1.7
alpha<-get_alpha(N, Y, b, br_X, K=Epan )
Yi <- make_Yi(pbc2, pbc2_id, X_lin, br_X, br_s, size_s_grid, size_X_grid, int_s, int_X,'years', n)
x = 2
t = 2
h_hat = h_xt(br_X, br_s, int_X, size_s_grid, alpha, x, t, b, Yi, n)