| Type: | Package |
| Title: | Bivariate Median Residual Life Estimation |
| Version: | 1.0.0 |
| Author: | Ruhul Ali Khan |
| Maintainer: | Ruhul Ali Khan <ruhulali.khan@gmail.com> |
| Description: | Nonparametric estimation of the bivariate median residual life function of Kayid et al. (2020) for complete and right-censored paired lifetimes. Order-restricted estimation for two groups is also provided, following Khan and Ghebremichael (2026). For censored data the bivariate survival function is estimated by the method of Lin and Ying (1993). Simultaneous confidence intervals are obtained by the percentile bootstrap approach of Mandel and Betensky (2008), and the estimated functions can be drawn as surface plots. See the accompanying vignette 'BMeRL' for a detailed introduction. Kayid, M., Shafaei Noughabi, M., and Abouammoh, A. M. (2020) <doi:10.1007/s00357-018-9300-z>; Khan, R. A., and Ghebremichael, M. (2026) <doi:10.1002/bimj.70112>; Lin, D. Y., and Ying, Z. (1993) <doi:10.1093/biomet/80.3.573>; Mandel, M., and Betensky, R. A. (2008) <doi:10.1016/j.csda.2007.07.005>. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| LazyData: | true |
| Depends: | R (≥ 3.6.0) |
| Imports: | stats, utils, graphics, grDevices |
| Suggests: | knitr, rmarkdown |
| VignetteBuilder: | knitr |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | no |
| Packaged: | 2026-10-05 20:40:59 UTC; rk128 |
| Repository: | CRAN |
| Date/Publication: | 2026-10-15 17:40:09 UTC |
BMeRL: Bivariate Median Residual Life
Description
Nonparametric estimation of the bivariate median residual life function of Kayid et al. (2020) for complete and right-censored paired lifetimes. Order-restricted estimation for two groups is also provided, following Khan and Ghebremichael (2026). For censored data, the bivariate survival function is estimated by the method of Lin and Ying (1993). Simultaneous confidence intervals are obtained by the percentile bootstrap approach of Mandel and Betensky (2008), and the estimated functions can be drawn as surface plots.
Estimation
-
BMeRL_Complete: bivariate median residual life for complete data. -
BMeRL_Censored: bivariate median residual life for right-censored data. -
BMeRL_Complete_ordered: bivariate median residual life for complete data in two groups, under an order restriction between the groups. -
BMeRL_Censored_ordered: bivariate median residual life for right-censored data in two groups, under an order restriction between the groups.
Surface plots
Each estimator has a matching surface-plot function:
BMeRL_Surface_complete, BMeRL_Surface_censored,
BMeRL_Surface_complete_ordered and
BMeRL_Surface_censored_ordered.
Data
Two artificial data sets, complete and
censored, simulated to illustrate all four estimators. The
column disease is used only by the order-restricted functions. It
must contain exactly two groups; otherwise these functions stop with an
error.
Author(s)
Maintainer: Ruhul Ali Khan ruhulali.khan@gmail.com (ORCID)
Authors:
Musie Ghebremichael musie_ghebremichael@dfci.harvard.edu (Project PI)
References
Kayid, M., Shafaei Noughabi, M., and Abouammoh, A. M. (2020). A nonparametric estimator of bivariate quantile residual life model with application to tumor recurrence data set. Journal of Classification, 37, 237–253. doi:10.1007/s00357-018-9300-z
Khan, R. A., and Ghebremichael, M. (2026). Bivariate quantile residual life functions for estimating immunological and virological recovery in HIV patients. Biometrical Journal, 68(2), e70112. doi:10.1002/bimj.70112
Lin, D. Y., and Ying, Z. (1993). A simple nonparametric estimator of the bivariate survival function under univariate censoring. Biometrika, 80(3), 573–581. doi:10.1093/biomet/80.3.573
Mandel, M., and Betensky, R. A. (2008). Simultaneous confidence intervals based on the percentile bootstrap approach. Computational Statistics and Data Analysis, 52(4), 2158–2165. doi:10.1016/j.csda.2007.07.005
Bivariate Median Residual Life for Right-Censored Data
Description
Estimates the bivariate median residual life function at one or more points from right-censored paired lifetimes and, optionally, computes bootstrap simultaneous confidence intervals (SCI).
Usage
BMeRL_Censored(
x1,
x2,
dataset,
time1,
time2,
status1,
status2,
SCI = FALSE,
B = 1000,
level = 0.95,
seed = NULL,
verbose = TRUE
)
Arguments
x1, x2 |
Numeric vectors of the same length specifying the points
|
dataset |
A data frame with one row per subject. |
time1, time2 |
Columns of |
status1, status2 |
Columns of |
SCI |
Logical. If |
B |
Number of bootstrap replications. Default is 1000. |
level |
Simultaneous confidence level, strictly between 0 and 1. Default is 0.95. |
seed |
Optional seed passed to |
verbose |
Logical. If |
Details
Censoring model. Each subject has a common censoring time
C, independent of the lifetimes (X_1, X_2). The observed
data are T_j = \min(X_j, C) and
\delta_j = I(X_j \le C), j = 1, 2.
Survival function. Following Lin and Ying (1993), the bivariate survival function is estimated by
\hat R(x_1, x_2) =
\frac{n^{-1}\sum_i I(T_{1i} > x_1,\ T_{2i} > x_2)}
{\hat G(\max(x_1, x_2))},
where \hat G is the Kaplan-Meier estimator of P(C > t),
computed from \max(T_{1i}, T_{2i}) with censoring indicators
1 - \delta_{1i}\delta_{2i}.
Median residual life. At a point (a, b), let
p = \hat R(a, b)/2. Along the first coordinate, let
t_1^{\le} be the first time t \ge a such that
\hat R(t, b) \le p, and let t_1^{<} be the first time such
that \hat R(t, b) < p. The estimated median location is the
midpoint of t_1^{\le} and t_1^{<}, with
t_1^{\le} used alone if the strict crossing does not occur.
Then \hat q_1(a, b) is this estimated median location minus
a. The estimator \hat q_2(a, b) is defined analogously
along the second coordinate. In the absence of censoring, this
construction reduces to the conventional sample median and agrees with
BMeRL_Complete.
If no paired observation lies beyond a point, both estimates are set to
0. An estimate is NA when
\hat G(\max(a, b)) = 0 or when the estimated survival function
does not reach the target level within the observed data.
SCI. The paired observations, including both observed times and
their corresponding event indicators, are resampled with replacement,
and \hat G is re-estimated in every bootstrap sample. The SCI are
based on the relative-rank method of Mandel and Betensky (2008), as
implemented in BMeRL_Complete, and are simultaneous for
q_1 and q_2 across all specified points. Bootstrap samples
containing an undefined estimate are dropped with a warning.
Value
If SCI = FALSE, a data frame with columns x1,
x2, q1, and q2, where q1 and q2
are the estimated first and second components of the bivariate median
residual life at each specified point.
If SCI = TRUE, the data frame additionally contains
q1_lower and q1_upper, the lower and upper simultaneous
confidence limits for q1, and q2_lower and
q2_upper, the corresponding simultaneous confidence limits for
q2. The intervals are simultaneous across both components and
all specified points. Additional bootstrap diagnostics are stored as
attributes of the returned data frame.
References
Kayid, M., Shafaei Noughabi, M., and Abouammoh, A. M. (2019). A nonparametric estimator of bivariate quantile residual life model with application to tumor recurrence data set. Journal of Classification. doi:10.1007/s00357-018-9300-z
Lin, D. Y. and Ying, Z. (1993). A simple nonparametric estimator of the bivariate survival function under univariate censoring. Biometrika, 80(3), 573–581.
Mandel, M. and Betensky, R. A. (2008). Simultaneous confidence intervals based on the percentile bootstrap approach. Computational Statistics and Data Analysis, 52(4), 2158–2165.
See Also
BMeRL_Censored_ordered for two ordered groups,
BMeRL_Complete for complete data, and
BMeRL_Surface_censored for surface plots.
Examples
data(censored)
## Point estimates only
BMeRL_Censored(
c(0, 5, 10), c(0, 5, 5), censored,
time1, time2, status1, status2
)
## Point estimates with 95% simultaneous confidence intervals
out <- BMeRL_Censored(
c(0, 5), c(0, 5), censored,
time1, time2, status1, status2,
SCI = TRUE, B = 200, seed = 1691, verbose = FALSE
)
out
Order-Restricted Bivariate Median Residual Life for Right-Censored Data
Description
Estimates the bivariate median residual life functions for two groups under an order restriction for right-censored data and, optionally, computes bootstrap simultaneous confidence intervals (SCI).
Usage
BMeRL_Censored_ordered(
x1,
x2,
dataset,
time1,
time2,
status1,
status2,
group,
smaller,
SCI = TRUE,
B = 1000,
level = 0.95,
seed = NULL,
verbose = TRUE
)
Arguments
x1, x2 |
Numeric vectors of the same length specifying the points
|
dataset |
A data frame with one row per subject. |
time1, time2 |
Columns of |
status1, status2 |
Columns of |
group |
Column of |
smaller |
The group to be denoted by |
SCI |
Logical. If |
B |
Number of bootstrap replications. Default is 1000. |
level |
Simultaneous confidence level, strictly between 0 and 1. Default is 0.95. |
seed |
Optional seed passed to |
verbose |
Logical. If |
Details
Let \mathbf{q}_F(x) = (q_{F1}(x), q_{F2}(x)) denote the bivariate
median residual life for the group specified by smaller, and let
\mathbf{q}_G(x) = (q_{G1}(x), q_{G2}(x)) denote that for the other
group, with sample sizes n_F and n_G, respectively. The
componentwise order restriction
q_{Fj}(x) \le q_{Gj}(x), j = 1, 2, is imposed at each specified
point x.
Let \hat{\mathbf{q}}_F and \hat{\mathbf{q}}_G denote the
unrestricted bivariate median residual life estimates for groups F
and G, respectively, obtained as in
BMeRL_Censored. Define the pooled estimate by
\hat{\mathbf{q}}_P =
\frac{n_F}{n_F + n_G}\hat{\mathbf{q}}_F +
\frac{n_G}{n_F + n_G}\hat{\mathbf{q}}_G.
The order-restricted estimates are then defined componentwise as
\hat{\mathbf{q}}_F^* =
\min(\hat{\mathbf{q}}_F, \hat{\mathbf{q}}_P), \qquad
\hat{\mathbf{q}}_G^* =
\max(\hat{\mathbf{q}}_G, \hat{\mathbf{q}}_P).
If the unrestricted estimates already satisfy
\hat q_{Fj} \le \hat q_{Gj}, they remain unchanged; otherwise, the
corresponding components are replaced by the pooled estimate. Thus,
\hat q_{Fj}^* \le \hat q_{Gj}^*, j = 1, 2, at every specified
point.
The censoring distribution is estimated separately within each group and re-estimated in every bootstrap sample. The paired observations, including both observed times and their corresponding event indicators, are resampled with replacement separately within groups. The pooled and order-restricted estimates are then recomputed for each bootstrap sample.
The SCI are based on the relative-rank method of Mandel and Betensky
(2008) and are simultaneous for both components of groups F and
G across all specified points. Within each coordinate, the bootstrap
estimates are ranked, and the largest absolute deviation of the
coordinatewise ranks from the central rank is used to construct the
simultaneous confidence limits. Near the boundary
\mathbf{q}_F = \mathbf{q}_G, the order-restricted estimators are
nonsmooth, and the percentile bootstrap may have coverage below the
nominal level.
Value
A data frame with one row for each specified point and group, with
columns x1, x2, group, q1, and q2,
where q1 and q2 are the order-restricted estimates of the
first and second components of the bivariate median residual life.
If SCI = TRUE, the data frame additionally contains
q1_lower and q1_upper, the lower and upper simultaneous
confidence limits for q1, and q2_lower and
q2_upper, the corresponding simultaneous confidence limits for
q2. The intervals are simultaneous across both components, both
groups, and all specified points.
The unrestricted estimates are stored in the unrestricted
attribute. Additional bootstrap diagnostics are stored as attributes of
the returned data frame when SCI = TRUE.
References
Kayid, M., Shafaei Noughabi, M., and Abouammoh, A. M. (2019). A nonparametric estimator of bivariate quantile residual life model with application to tumor recurrence data set. Journal of Classification. doi:10.1007/s00357-018-9300-z
Lin, D. Y. and Ying, Z. (1993). A simple nonparametric estimator of the bivariate survival function under univariate censoring. Biometrika, 80(3), 573–581.
Mandel, M., and Betensky, R. A. (2008). Simultaneous confidence intervals based on the percentile bootstrap approach. Computational Statistics and Data Analysis, 52(4), 2158–2165.
See Also
BMeRL_Censored for unrestricted censored-data
estimation, BMeRL_Complete_ordered for complete data, and
BMeRL_Surface_censored_ordered for surface plots.
Examples
data(censored)
## Point estimates, with group "Yes" denoted by F and assumed to have
## the smaller bivariate median residual life
BMeRL_Censored_ordered(
c(0, 5, 10), c(0, 5, 5), censored,
time1, time2, status1, status2, disease,
smaller = "Yes", SCI = FALSE
)
## With 95% simultaneous confidence intervals
BMeRL_Censored_ordered(
c(0, 5), c(0, 5), censored,
time1, time2, status1, status2, disease,
smaller = "Yes", B = 200, seed = 1691,
verbose = FALSE
)
Bivariate Median Residual Life for Complete Data
Description
Estimates the bivariate median residual life function at one or more points from complete (uncensored) paired lifetimes and, optionally, computes bootstrap simultaneous confidence intervals (SCI).
Usage
BMeRL_Complete(
x1,
x2,
dataset,
time1,
time2,
SCI = TRUE,
B = 1000,
level = 0.95,
seed = NULL,
verbose = TRUE
)
Arguments
x1, x2 |
Numeric vectors of the same length specifying the points
|
dataset |
A data frame with one row per subject. |
time1, time2 |
Columns of |
SCI |
Logical. If |
B |
Number of bootstrap replications. Default is 1000. |
level |
Simultaneous confidence level, strictly between 0 and 1. Default is 0.95. |
seed |
Optional seed passed to |
verbose |
Logical. If |
Details
At a point x = (x_1, x_2), the median residual lives are
\hat q_1(x_1, x_2) = \mathrm{median}\{X_{1i} : X_{1i} > x_1,\ X_{2i} > x_2\} - x_1,
\hat q_2(x_1, x_2) = \mathrm{median}\{X_{2i} : X_{1i} > x_1,\ X_{2i} > x_2\} - x_2,
where the conventional sample median is used, averaging the two middle
values when the number of paired observations beyond the point is even.
Together, \hat q_1 and \hat q_2 define the bivariate median
residual life at x. If no paired observation lies beyond a point,
both estimates are set to 0.
The SCI are based on the relative-rank method of Mandel and Betensky
(2008) and are simultaneous for q_1 and q_2 across all
specified points. The paired observations are resampled with replacement
B times. Within each coordinate, the bootstrap estimates are ranked:
tied values below the median receive the minimum rank of their group, tied
values above the median receive the maximum rank, and values equal to the
median are treated as central. For each bootstrap sample, the largest
absolute deviation of the coordinatewise ranks from the central rank is
computed. The central level proportion of bootstrap samples is
retained, and the minimum and maximum retained bootstrap estimates in each
coordinate define the simultaneous confidence limits.
Value
If SCI = FALSE, a data frame with columns x1,
x2, q1, and q2, where q1 and q2
are the estimated first and second components of the bivariate median
residual life at each specified point.
If SCI = TRUE, the data frame additionally contains
q1_lower and q1_upper, the lower and upper simultaneous
confidence limits for q1, and q2_lower and
q2_upper, the corresponding simultaneous confidence limits for
q2. The intervals are simultaneous across both components and
all specified points. Additional bootstrap diagnostics are stored as
attributes of the returned data frame.
References
Kayid, M., Shafaei Noughabi, M., and Abouammoh, A. M. (2020). A nonparametric estimator of bivariate quantile residual life model with application to tumor recurrence data set. Journal of Classification, 37, 237–253. doi:10.1007/s00357-018-9300-z
Mandel, M., and Betensky, R. A. (2008). Simultaneous confidence intervals based on the percentile bootstrap approach. Computational Statistics and Data Analysis, 52(4), 2158–2165. doi:10.1016/j.csda.2007.07.005
See Also
BMeRL_Complete_ordered for two ordered groups,
BMeRL_Censored for censored data, and
BMeRL_Surface_complete for surface plots.
Examples
data(complete)
## Point estimates only
BMeRL_Complete(c(0, 5, 10), c(0, 5, 5), complete, time1, time2,
SCI = FALSE)
## Point estimates with 95% simultaneous confidence intervals
out <- BMeRL_Complete(c(0, 5), c(0, 5), complete, time1, time2,
B = 200, seed = 1691, verbose = FALSE)
out
Order-Restricted Bivariate Median Residual Life for Complete Data
Description
Estimates the bivariate median residual life functions for two groups under an order restriction for complete (uncensored) data and, optionally, computes bootstrap simultaneous confidence intervals (SCI).
Usage
BMeRL_Complete_ordered(
x1,
x2,
dataset,
time1,
time2,
group,
smaller,
SCI = TRUE,
B = 1000,
level = 0.95,
seed = NULL,
verbose = TRUE
)
Arguments
x1, x2 |
Numeric vectors of the same length specifying the points
|
dataset |
A data frame with one row per subject. |
time1, time2 |
Columns of |
group |
Column of |
smaller |
The group to be denoted by |
SCI |
Logical. If |
B |
Number of bootstrap replications. Default is 1000. |
level |
Simultaneous confidence level, strictly between 0 and 1. Default is 0.95. |
seed |
Optional seed passed to |
verbose |
Logical. If |
Details
Let \mathbf{q}_F(x) = (q_{F1}(x), q_{F2}(x)) denote the bivariate
median residual life for the group specified by smaller, and let
\mathbf{q}_G(x) = (q_{G1}(x), q_{G2}(x)) denote that for the other
group, with sample sizes n_F and n_G, respectively. The
componentwise order restriction
q_{Fj}(x) \le q_{Gj}(x), j = 1, 2, is imposed at each specified
point x.
Let \hat q_F and \hat q_G denote the unrestricted bivariate
median residual life estimates for groups F and G, respectively,
obtained as in BMeRL_Complete. Define the pooled estimate by
\hat q_P =
\frac{n_F}{n_F + n_G}\hat q_F +
\frac{n_G}{n_F + n_G}\hat q_G.
The order-restricted estimates are then defined componentwise as
\hat q_F^* = \min(\hat q_F, \hat q_P), \qquad
\hat q_G^* = \max(\hat q_G, \hat q_P).
If the unrestricted estimates already satisfy
\hat q_F \le \hat q_G, they remain unchanged; otherwise, both are
replaced by the pooled estimate. Thus,
\hat q_F^* \le \hat q_G^* at every specified point.
The SCI are based on the relative-rank method of Mandel and Betensky
(2008) and are simultaneous for both components of groups F and
G across all specified points. The paired observations are resampled
with replacement separately within each group, and the pooled and
order-restricted estimates are recomputed in each bootstrap sample.
Within each coordinate, the bootstrap estimates are ranked, and the largest
absolute deviation of the coordinatewise ranks from the central rank is
used to construct the simultaneous confidence limits.
Value
A data frame with one row for each specified point and group, with
columns x1, x2, group, q1, and q2,
where q1 and q2 are the order-restricted estimates of the
first and second components of the bivariate median residual life.
If SCI = TRUE, the data frame additionally contains
q1_lower and q1_upper, the lower and upper simultaneous
confidence limits for q1, and q2_lower and
q2_upper, the corresponding simultaneous confidence limits for
q2. The intervals are simultaneous across both components, both
groups, and all specified points.
The unrestricted estimates are stored in the unrestricted
attribute. Additional bootstrap diagnostics are stored as attributes of
the returned data frame when SCI = TRUE.
References
Kayid, M., Shafaei Noughabi, M., and Abouammoh, A. M. (2019). A nonparametric estimator of bivariate quantile residual life model with application to tumor recurrence data set. Journal of Classification. doi:10.1007/s00357-018-9300-z
Mandel, M., and Betensky, R. A. (2008). Simultaneous confidence intervals based on the percentile bootstrap approach. Computational Statistics and Data Analysis, 52(4), 2158–2165.
See Also
BMeRL_Complete,
BMeRL_Censored_ordered, and
BMeRL_Surface_complete_ordered.
Examples
data(complete)
## Point estimates, with group "Yes" denoted by F and assumed to have
## the smaller bivariate median residual life
est <- BMeRL_Complete_ordered(
c(0, 5, 10), c(0, 5, 5), complete,
time1, time2, disease, smaller = "Yes",
SCI = FALSE
)
est
## With 95% simultaneous confidence intervals
BMeRL_Complete_ordered(
c(0, 5), c(0, 5), complete,
time1, time2, disease, smaller = "Yes",
B = 200, seed = 1691, verbose = FALSE
)
Surface Plots of the Bivariate Median Residual Life
Description
Evaluates a bivariate median residual life estimator over a grid of
points and displays the two components \hat q_1 and
\hat q_2 as surface plots.
Usage
BMeRL_Surface_complete(
dataset,
time1,
time2,
x1.grid = NULL,
x2.grid = NULL,
n.grid = 30,
which = c("both", "q1", "q2"),
plot = TRUE,
theta = 35,
phi = 25,
col.palette = 50,
main = NULL,
...
)
BMeRL_Surface_censored(
dataset,
time1,
time2,
status1,
status2,
x1.grid = NULL,
x2.grid = NULL,
n.grid = 30,
which = c("both", "q1", "q2"),
plot = TRUE,
theta = 35,
phi = 25,
col.palette = 50,
main = NULL,
...
)
BMeRL_Surface_complete_ordered(
dataset,
time1,
time2,
group,
smaller,
x1.grid = NULL,
x2.grid = NULL,
n.grid = 30,
which = c("both", "q1", "q2"),
plot = TRUE,
theta = 35,
phi = 25,
col.palette = 50,
main = NULL,
...
)
BMeRL_Surface_censored_ordered(
dataset,
time1,
time2,
status1,
status2,
group,
smaller,
x1.grid = NULL,
x2.grid = NULL,
n.grid = 30,
which = c("both", "q1", "q2"),
plot = TRUE,
theta = 35,
phi = 25,
col.palette = 50,
main = NULL,
...
)
Arguments
dataset |
A data frame with one row per subject. |
time1, time2 |
Columns of |
x1.grid, x2.grid |
Increasing numeric vectors specifying the grid.
If |
n.grid |
Number of grid values in each direction when a grid is not supplied. Default is 30. |
which |
Component(s) to display: |
plot |
Logical. If |
theta, phi |
Viewing angles passed to |
col.palette |
Number of colours, or a vector of colours, used to
colour the surface facets from lower to higher values. The default is
50 colours from |
main |
Optional plot titles, one for each component. If
|
... |
Additional arguments passed to
|
status1, status2 |
Columns of |
group |
Column of |
smaller |
The group to be denoted by |
Details
-
BMeRL_Surface_completeusesBMeRL_Complete; -
BMeRL_Surface_censoredusesBMeRL_Censored; -
BMeRL_Surface_complete_orderedusesBMeRL_Complete_ordered; -
BMeRL_Surface_censored_orderedusesBMeRL_Censored_ordered.
The estimator is evaluated with SCI = FALSE at each grid point.
The surfaces of \hat q_1 and \hat q_2 are displayed side by
side. For the order-restricted estimators, one row is shown for each
group, with group F first and group G second. The two groups
share the same vertical and colour scales for each component, allowing
their surfaces to be compared directly. Surface facets are coloured
according to their height. Grid points at which an estimate is
NA are left blank. Graphical parameters modified for the layout
are restored on exit.
Value
Invisibly, a list with components x1 and x2,
containing the grid values, and q1 and q2, containing
the corresponding bivariate median residual life estimates. For the
unrestricted estimators, q1 and q2 are matrices with
rows corresponding to x1 and columns corresponding to
x2. For the order-restricted estimators, each is a list
containing one such matrix for each group.
References
Kayid, M., Shafaei Noughabi, M., and Abouammoh, A. M. (2019). A nonparametric estimator of bivariate quantile residual life model with application to tumor recurrence data set. Journal of Classification. doi:10.1007/s00357-018-9300-z
Examples
data(complete)
data(censored)
BMeRL_Surface_complete(
complete, time1, time2,
x1.grid = 0:30, x2.grid = 0:30
)
BMeRL_Surface_censored(
censored, time1, time2, status1, status2,
x1.grid = 0:30, x2.grid = 0:30
)
BMeRL_Surface_complete_ordered(
complete, time1, time2, disease, "Yes",
x1.grid = 0:30, x2.grid = 0:30
)
BMeRL_Surface_censored_ordered(
censored, time1, time2, status1, status2,
disease, "Yes",
x1.grid = 0:30, x2.grid = 0:30,
which = "q1"
)
## Return the grid of estimates without drawing the surfaces
s <- BMeRL_Surface_complete(
complete, time1, time2,
n.grid = 10, plot = FALSE
)
round(s$q1, 1)
Simulated Right-Censored Bivariate Lifetimes
Description
A simulated data set containing the subjects in complete
observed under right censoring. The data were generated to illustrate the
censored-data methods in the package and do not represent real subjects.
The variables time1, time2, status1, and
status2 are used by BMeRL_Censored and
BMeRL_Surface_censored. The order-restricted functions
BMeRL_Censored_ordered and
BMeRL_Surface_censored_ordered additionally use the group
variable disease.
Usage
censored
Format
A data frame with 120 rows and 6 variables:
- id
Subject identifier.
- time1
Observed time for the first component, in months, defined as the minimum of the lifetime and censoring time.
- time2
Observed time for the second component, in months, defined as the minimum of the lifetime and censoring time.
- status1
Event indicator for
time1: 1 if the event time was observed and 0 if it was censored.- status2
Event indicator for
time2: 1 if the event time was observed and 0 if it was censored.- disease
Group indicator used by the order-restricted functions:
"Yes"for 50 subjects and"No"for 70 subjects.
Details
Each subject has a single censoring time drawn from a uniform distribution
on 0 to 60 months and applied to both component lifetimes in
complete. Approximately 42% of the subjects have at least
one censored component.
Source
Simulated data generated for this package.
See Also
complete, which contains the same subjects without
censoring.
Examples
data(censored)
head(censored)
mean(censored$status1 == 0)
Simulated Complete Bivariate Lifetimes
Description
A simulated/artificial data set of paired lifetimes (in months) for 120 subjects,
generated to illustrate the complete-data methods in the package. The data
are uncensored and do not represent real subjects. The variables
time1 and time2 are used by
BMeRL_Complete and
BMeRL_Surface_complete. The order-restricted functions
BMeRL_Complete_ordered and
BMeRL_Surface_complete_ordered additionally use the group
variable disease.
Usage
complete
Format
A data frame with 120 rows and 4 variables:
- id
Subject identifier.
- time1
Lifetime of the first component, in months.
- time2
Lifetime of the second component, in months.
- disease
Group indicator used by the order-restricted functions:
"Yes"for 50 subjects and"No"for 70 subjects.
Details
The paired lifetimes were simulated from Gumbel's bivariate exponential
distribution with dependence parameter 0.5 and scaled to have mean
lifetimes of 12 months in group "Yes" and 18 months in group
"No". Thus, group "Yes" has the smaller median residual
life. The observed times are rounded to 0.1 month, with 0.1 as the
smallest recorded value.
Source
Simulated data generated for this package.
See Also
censored, which contains the same subjects under
right censoring.
Examples
data(complete)
head(complete)
table(complete$disease)