get_alpha {HQM} | R Documentation |
Marker-only hazard rate
Description
Calculates the marker-only hazard rate for time dependent data.
Usage
get_alpha(N, Y, b, br_X, K=Epan )
Arguments
N |
A matrix made by |
Y |
A matrix made by |
b |
Bandwidth. |
br_X |
Vector of grid points for the marker values |
K |
Used kernel function. |
Details
The function get_alpha
implements the marker-only hazard estimator
\hat{\alpha}_i(z) = \frac{\sum_{k\neq i}\int_0^T K_{b_1}(z-X_k(s))\mathrm{d}N_k(s)}{\sum_{k\neq i}\int_0^T K_{b_1}(z-X_k(s))Z_k(s)\mathrm{d}s},
where X
is the marker and Z
is the exposure. The marker-only hazard is defined as the underlying hazard which is not dependent on time
\alpha(X(t),t) = \alpha(X(t))
.
Value
A vector of marker-only values for br_X
.
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, event_time = 'years', n)
b = 1.7
alpha<-get_alpha(N, Y, b, br_X, K=Epan )
[Package HQM version 0.1.0 Index]