| Title: | Joint Covariance and Treatment-Effect Tests for Multiple Outcomes |
|---|---|
| Description: | Fits generalized linear models, Cox proportional-hazards models, log-rank tests, generalized estimating equations, mixed models with repeated measures, Kaplan-Meier curves, quantile differences, and hierarchical net-benefit (win-difference) statistics jointly across multiple endpoints, and returns the full asymptotic covariance matrix linking them. Implements PATED (Prognostic Assisted Treatment Effect Detection), a randomized-trial method that exploits balanced prognostic covariates to tighten standard errors and increase statistical power without introducing bias. |
| Authors: | Han Zhang [aut, cre] |
| Maintainer: | Han Zhang <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.17.1 |
| Built: | 2026-06-02 05:35:58 UTC |
| Source: | https://github.com/zhangh12/multipleoutcomes |
actg dataset from Hosmer et al.
A data frame
Identification Code
Time to AIDS diagnosis or death (days).
Event indicator. 1 = AIDS defining diagnosis, 0 = Otherwise.
Time to death (days)
Event indicator for death (only). 1 = Death, 0 = Otherwise.
Treatment indicator. 1 = Treatment includes IDV, 0 = Control group.
Treatment group indicator. 1 = ZDV + 3TC. 2 = ZDV + 3TC + IDV. 3 = d4T + 3TC. 4 = d4T + 3TC + IDV.
CD4 stratum at screening. 0 = CD4 <= 50. 1 = CD4 > 50.
0 = Male. 1 = Female.
Race/Ethnicity. 1 = White Non-Hispanic. 2 = Black Non-Hispanic. 3 = Hispanic. 4 = Asian, Pacific Islander. 5 = American Indian, Alaskan Native. 6 = Other/unknown.
IV drug use history. 1 = Never. 2 = Currently. 3 = Previously.
Hemophiliac. 1 = Yes. 0 = No.
Karnofsky Performance Scale. 100 = Normal; no complaint no evidence of disease. 90 = Normal activity possible; minor signs/symptoms of disease. 80 = Normal activity with effort; some signs/symptoms of disease. 70 = Cares for self; normal activity/active work not possible.
Baseline CD4 count (Cells/Milliliter).
Months of prior ZDV use (months).
Age at Enrollment (years).
ftp://ftp.wiley.com/public/sci_tech_med/survival
Hosmer, D.W. and Lemeshow, S. and May, S. (2008) Applied Survival Analysis: Regression Modeling of Time to Event Data: Second Edition, John Wiley and Sons Inc., New York, NY
data(actg)data(actg)
coef is a generic function.
## S3 method for class 'jointCovariance' coef(object, model_index = NULL, ...)## S3 method for class 'jointCovariance' coef(object, model_index = NULL, ...)
object |
an object returned by |
model_index |
|
... |
for debugging only |
a vector of coefficient estimates
coxph_ is a wrapper function of survival::coxph to create an object to be
passed into jointCovariance, the main function of this package through its
argument .... The object defines how a proportional hazard model would be
fitted.
coxph_(formula, data_index = 1)coxph_(formula, data_index = 1)
formula |
see |
data_index |
integer. Index of the data frame in the |
Not all arguments of survival::coxph are supported in coxph_ due to the
complexity in handling environment and scope, which is particularly difficult
for arguments like weights, subset, etc.
gee_ is a wrapper function of gee::gee to create an object to be passed
into jointCovariance, the main function of this package through its
argument .... The object defines how a GEE model would be fitted.
This package does not import the package gee. Instead, codes of gee are
modified and integrated to compute score and information matrix. Thus, users
does not need to install the package gee to use this package.
gee_(formula, family, corstr, R = NULL, b = NULL, Mv = 1, data_index = 1)gee_(formula, family, corstr, R = NULL, b = NULL, Mv = 1, data_index = 1)
formula |
see |
family |
see |
corstr |
see |
R |
see |
b |
see |
Mv |
see |
data_index |
integer. Index of the data frame in the |
Not all arguments of stats::gee are supported in gee_ due to the
complexity in handling environment and scope, which is particularly difficult
for arguments like subset, etc.
glm_ is a wrapper function of stats::glm to create an object to be passed
into jointCovariance, the main function of this package through its
argument .... The object defines how a GLM model would be fitted.
glm_(formula, family, data_index = 1)glm_(formula, family, data_index = 1)
formula |
see |
family |
currently supports |
data_index |
integer. Index of the data frame in the |
Not all arguments of stats::glm are supported in glm_ due to the
complexity in handling environment and scope, which is particularly difficult
for arguments like weights, subset, etc.
Patient-level data from a multi-center, randomized, double-blind, placebo-controlled 2-arm trial (n = 602) of rectal indomethacin (100 mg) versus placebo to prevent post-ERCP pancreatitis in high-risk patients, as reported by Elmunzer, Higgins, et al. (2012) in the New England Journal of Medicine.
This dataset was originally collected, cleaned, reformatted, and released
for public teaching and research use by Dr. Peter D. R. Higgins in the
medicaldata R package as indo_rct. The version shipped here is
redistributed in support of the worked examples in this package. The
variable definitions below follow medicaldata; note that a few
columns are stored as numeric (rather than factor) in this copy. Users who
need the authoritative copy or accompanying documentation should consult
medicaldata.
A data frame with 602 observations on the following 33 variables:
idSubject identifier (numeric); leading digit indicates center. Range 1001–4003.
siteStudy site (factor, 4 levels):
1_UM = University of Michigan,
2_IU = Indiana University,
3_UK = University of Kentucky,
4_Case = Case Western Reserve University.
ageAge in years (numeric), range 19–90.
riskRisk score for post-ERCP pancreatitis (numeric), range 1–5.5.
genderSex (factor): 1_female, 2_male.
outcomePrimary outcome: post-ERCP pancreatitis (numeric, 1 = yes, 0 = no).
sodSphincter of Oddi dysfunction present (factor):
0_no, 1_yes.
pepHistory of prior post-ERCP pancreatitis (factor):
0_no, 1_yes.
recpancHistory of recurrent pancreatitis (factor):
0_no, 1_yes.
psphincPancreatic sphincterotomy performed (factor):
0_no, 1_yes.
precutSphincter pre-cut needed to enter papilla (factor):
0_no, 1_yes.
difcanCannulation of papilla was difficult (factor):
0_no, 1_yes.
pneudilPneumatic dilation of papilla performed (factor):
0_no, 1_yes.
ampAmpullectomy performed (factor):
0_no, 1_yes.
paninjContrast injected into pancreas (factor):
0_no, 1_yes.
acinarPancreas appeared to have acinarization on imaging
(factor): 0_no, 1_yes.
brushBrushings taken from pancreatic duct (factor):
0_no, 1_yes.
asa81Aspirin used at 81 mg per day (factor with 3 levels):
0_no, 1_yes, and a third level retained from the
source coding.
asa325Aspirin used at 325 mg per day (factor with 3
levels): 0_no, 1_yes, and a third level retained from
the source coding.
asaAspirin used at any dose (factor with 3 levels):
0_no, 1_yes, and a third level retained from the
source coding.
prophystentPancreatic duct stent placed per endoscopist
judgment (factor): 0_no, 1_yes.
therastentPancreatic duct stent placed to treat narrowing
(factor): 0_no, 1_yes.
pdstentPancreatic duct stent placed for any reason
(factor): 0_no, 1_yes.
sodsomSphincter of Oddi manometry performed (factor):
0_no, 1_yes.
bsphincBiliary sphincterotomy performed (factor):
0_no, 1_yes.
bstentBiliary stent placed to relieve obstruction
(factor): 0_no, 1_yes.
choleCholedocholithiasis present (factor):
0_no, 1_yes.
pbmalBiliary duct or pancreatic malignancy found (factor):
0_no, 1_yes.
trainTrainee participated in ERCP (factor):
0_no, 1_yes.
statusPatient status (factor):
0_inpatient, 1_outpatient.
typeSphincter of Oddi dysfunction type (factor):
0_no SOD, 1_type 1, 2_type 2, 3_type 3.
rxTreatment assignment (numeric, 1 = indomethacin, 0 = placebo).
bleedReportable gastrointestinal bleeding (numeric,
coded 1 = no, 2 = yes; NA when not assessed).
Higgins, P. D. R. medicaldata: Data Package for Medical Datasets.
R package, dataset indo_rct.
https://CRAN.R-project.org/package=medicaldata
Elmunzer BJ, Higgins PDR, Saini SD, et al. A randomized trial of rectal indomethacin to prevent post-ERCP pancreatitis. New England Journal of Medicine 2012; 366(15):1414–1422. doi:10.1056/NEJMoa1111103
data(indo)data(indo)
jointCovariance can fit different types of models for multiple outcomes
simultaneously and return model parameters and variance-covariance matrix
for further analysis.
jointCovariance(..., data, nboot = 0, compute_cov = TRUE, seed = NULL)jointCovariance(..., data, nboot = 0, compute_cov = TRUE, seed = NULL)
... |
objects returned by |
data |
a data frame if all models are fitted on the same dataset;
otherwise a list of data frames for fitting models in |
nboot |
non-zero integer if bootstrap is adopted. By default 0. |
compute_cov |
logic. If |
seed |
random seed when generate bootstrap data. |
It returns an object of class "jointCovariance", which is a list containing the following components:
coefficients |
an unnamed vector of coefficients of all fitted models.
Use id_map for variable mapping. |
mcov |
a unnamed matrix of covariance of coefficients. Use id_map
for variable mapping. |
id_map |
a list mapping the elements in coefficients and mcov to
variable names. |
n_shared_sample_sizes |
a matrix of shared sample sizes between datasets being used to fit the models. |
call |
the matched call. |
## More examples can be found in the vignettes. library(survival) library(mvtnorm) library(tidyr) genData <- function(seed = NULL){ set.seed(seed) n <- 300 sigma <- matrix(.7, 4, 4) diag(sigma) <- 1 v <- rmvnorm(n, sigma = sigma) x1 <- v[, 1] x2 <- v[, 2] z1 <- (v[, 3] > 0) + 0 z2 <- v[, 4] trt <- rbinom(n, 1, .5) bet <- c(-.3,.3) y <- -log(runif(n))/ exp(-.3 * x1 + .3 * x2 + z1 * .5 - z2 * .3 + .1 * trt + rnorm(n)) z1[sample.int(n, 50)] <- NA z2[sample.int(n, 50)] <- NA x1[sample.int(n, 50)] <- NA x2[sample.int(n, 50)] <- NA death <- ifelse(y > 2, 0, 1) y[y > 2] <- 2 pid <- paste0('pid-', 1:n) ret <- data.frame( y = y, trt = trt, z1 = z1, z2 = z2, x1 = x1, x2 = x2, death, pid) ret } dat1 <- genData() ## create a dataset with repeated measurements x dat2 <- dat1 %>% pivot_longer(c(x1, x2), names_to='visit', values_to='x') %>% dplyr::select(x, trt, visit, pid) %>% as.data.frame() dat2$visit <- as.factor(dat2$visit) dat2$pid <- as.factor(dat2$pid) fit <- jointCovariance( coxph_(Surv(time = y, event = death) ~ trt, data_index = 1), logrank_(Surv(time = y, event=death) ~ trt, data_index = 1), glm_(z1 ~ trt, family = 'binomial', data_index = 1), glm_(z2 ~ trt, family = 'gaussian', data_index = 1), mmrm_(x ~ trt + us(visit | pid), reml = TRUE, data_index = 2), gee_(x ~ trt, family = 'gaussian', corstr = 'independence', data_index = 2), data = list(dat1, dat2)) fit bfit <-jointCovariance( coxph_(Surv(time=y, event=death) ~ trt, data_index = 1), logrank_(Surv(time=y, event=death) ~ trt, data_index = 1), glm_(z1 ~ trt, family = 'binomial', data_index = 1), glm_(z2 ~ trt, family = 'gaussian', data_index = 1), mmrm_(x ~ trt + us(visit | pid), reml = TRUE, data_index = 2), gee_(x ~ trt, family = 'gaussian', corstr = 'independence', data_index = 2), data = list(dat1, dat2), nboot = 10) summary(bfit) ## km_() and quantile_() require nboot > 0 because they have no ## closed-form score. compute_cov is forced to FALSE for km_(). ## When all models share one dataset, `data_index` and `list(...)` ## can be omitted. kfit <- jointCovariance( km_(Surv(time = y, event = death) ~ trt, conf_type = 'log', times = c(0.5, 1, 1.5)), glm_(z1 ~ trt, family = 'binomial'), data = dat1, nboot = 30, seed = 1) qfit <- jointCovariance( quantile_(y ~ trt, probs = c(0.25, 0.5, 0.75)), glm_(z2 ~ trt, family = 'gaussian'), data = dat1, nboot = 30, seed = 1)## More examples can be found in the vignettes. library(survival) library(mvtnorm) library(tidyr) genData <- function(seed = NULL){ set.seed(seed) n <- 300 sigma <- matrix(.7, 4, 4) diag(sigma) <- 1 v <- rmvnorm(n, sigma = sigma) x1 <- v[, 1] x2 <- v[, 2] z1 <- (v[, 3] > 0) + 0 z2 <- v[, 4] trt <- rbinom(n, 1, .5) bet <- c(-.3,.3) y <- -log(runif(n))/ exp(-.3 * x1 + .3 * x2 + z1 * .5 - z2 * .3 + .1 * trt + rnorm(n)) z1[sample.int(n, 50)] <- NA z2[sample.int(n, 50)] <- NA x1[sample.int(n, 50)] <- NA x2[sample.int(n, 50)] <- NA death <- ifelse(y > 2, 0, 1) y[y > 2] <- 2 pid <- paste0('pid-', 1:n) ret <- data.frame( y = y, trt = trt, z1 = z1, z2 = z2, x1 = x1, x2 = x2, death, pid) ret } dat1 <- genData() ## create a dataset with repeated measurements x dat2 <- dat1 %>% pivot_longer(c(x1, x2), names_to='visit', values_to='x') %>% dplyr::select(x, trt, visit, pid) %>% as.data.frame() dat2$visit <- as.factor(dat2$visit) dat2$pid <- as.factor(dat2$pid) fit <- jointCovariance( coxph_(Surv(time = y, event = death) ~ trt, data_index = 1), logrank_(Surv(time = y, event=death) ~ trt, data_index = 1), glm_(z1 ~ trt, family = 'binomial', data_index = 1), glm_(z2 ~ trt, family = 'gaussian', data_index = 1), mmrm_(x ~ trt + us(visit | pid), reml = TRUE, data_index = 2), gee_(x ~ trt, family = 'gaussian', corstr = 'independence', data_index = 2), data = list(dat1, dat2)) fit bfit <-jointCovariance( coxph_(Surv(time=y, event=death) ~ trt, data_index = 1), logrank_(Surv(time=y, event=death) ~ trt, data_index = 1), glm_(z1 ~ trt, family = 'binomial', data_index = 1), glm_(z2 ~ trt, family = 'gaussian', data_index = 1), mmrm_(x ~ trt + us(visit | pid), reml = TRUE, data_index = 2), gee_(x ~ trt, family = 'gaussian', corstr = 'independence', data_index = 2), data = list(dat1, dat2), nboot = 10) summary(bfit) ## km_() and quantile_() require nboot > 0 because they have no ## closed-form score. compute_cov is forced to FALSE for km_(). ## When all models share one dataset, `data_index` and `list(...)` ## can be omitted. kfit <- jointCovariance( km_(Surv(time = y, event = death) ~ trt, conf_type = 'log', times = c(0.5, 1, 1.5)), glm_(z1 ~ trt, family = 'binomial'), data = dat1, nboot = 30, seed = 1) qfit <- jointCovariance( quantile_(y ~ trt, probs = c(0.25, 0.5, 0.75)), glm_(z2 ~ trt, family = 'gaussian'), data = dat1, nboot = 30, seed = 1)
km_ is a wrapper function creating an object of Kaplan-Meier curve to be
passed into jointCovariance, the main function of this package through its
argument .... The object defines how a Kaplan-Meier curve would be fitted.
km_(formula, times = NULL, conf_type, data_index = 1)km_(formula, times = NULL, conf_type, data_index = 1)
formula |
a formula created by |
times |
numeric vector of time. Survival probabilities at |
conf_type |
character. Type of confidence interval. It must be one of
|
data_index |
integer. Index of the data frame in the |
Usually, g-transformation is applied to the survival probability S(t)
to obtain pointwise confidence interval of a Kaplan-Meier curve. This
can be achieved by specifying conf_type. For identity transformation,
use conf_type = "plain".
This function can only be used with jointCovariance when the bootstrap
method is used to estimate variance-covariance matrix of multiple outcome
models.
logrank_ is a wrapper function survival::coxph to create an object to be
passed into jointCovariance, the main function of this package through its
argument .... Logrank test is the score test under the proportional hazards
regression model. The object defines how a logrank test would be computed.
logrank_(formula, ties = c("efron", "breslow", "exact"), data_index = 1)logrank_(formula, ties = c("efron", "breslow", "exact"), data_index = 1)
formula |
see |
ties |
character string specifying the method for tie handling. One of
|
data_index |
integer. Index of the data frame in the |
Not all arguments of survival::coxph are supported in logrank_ due to the
complexity in handling environment and scope, which is particularly difficult
for arguments like weights, subset, etc.
mmrm_ is a wrapper function of mmrm::mmrm to create an object to be passed
into jointCovariance, the main function of this package through its
argument .... The object defines how a MMRM model would be fitted.
mmrm_( formula, covariance = NULL, reml = TRUE, control = mmrm::mmrm_control(...), ..., data_index = 1 )mmrm_( formula, covariance = NULL, reml = TRUE, control = mmrm::mmrm_control(...), ..., data_index = 1 )
formula |
see |
covariance |
see |
reml |
see |
control |
see |
... |
see |
data_index |
integer. Index of the data frame in the |
The argument weights of mmrm::mmrm is supported in mmrm_ due to the
complexity in handling environment and scope.
Please always refer to help document of mmrm::mmrm before using mmrm_.
For example, time variable and observation ID must be factor variables in
some cases, otherwise error may be prompted. Users can call mmrm::mmrm
using the same arguments being passed to mmrm_ to check validity.
These helpers build the individual endpoint specifications that
netbenefit_() consumes through its endpoints argument. Each call
returns a small list describing one comparison rule; the order in
which they appear in the endpoints list defines the hierarchical
priority (first = highest).
nb_tte( time, event, direction = c("longer_better", "shorter_better"), margin = 0, censor_rule = c("informative", "ignore") ) nb_continuous( value, direction = c("larger_better", "smaller_better"), margin = 0 ) nb_binary(value, direction = c("larger_better", "smaller_better"))nb_tte( time, event, direction = c("longer_better", "shorter_better"), margin = 0, censor_rule = c("informative", "ignore") ) nb_continuous( value, direction = c("larger_better", "smaller_better"), margin = 0 ) nb_binary(value, direction = c("larger_better", "smaller_better"))
time |
character. Name of the time column in |
event |
character. Name of the event-indicator column in |
direction |
one of |
margin |
non-negative numeric. Minimum directional gap required to declare a winner on this endpoint. Defaults to 0. |
censor_rule |
( |
value |
character. Name of the outcome column in |
An object of class c("nb_endpoint_<type>", "nb_endpoint")
carrying the rule and its arguments.
For each endpoint type, direction says whether a larger value (or
longer time, for TTE) counts as a win for the subject. With the
default convention, a treatment subject "wins" the endpoint when its
value, possibly minus a margin, exceeds the control subject's value.
Flip the default for endpoints where smaller (or shorter) is better
(e.g., pain scores; time to symptom relief).
margin is a non-negative clinically meaningful difference threshold.
A pair only declares a winner when the directional gap strictly exceeds
margin; otherwise the pair ties at this endpoint and falls through to
the next one. nb_binary() does not expose margin because binary
values admit only two outcomes.
nb_tte() accepts a censor_rule argument. The default
"informative" matches the conventional Pocock/Buyse rule: if one
subject is censored and the other observed, a winner can only be
declared in the direction the censoring is uninformative about (i.e.,
the censored time is already past the event time). "ignore" drops
pairs where either subject is censored and treats them as ties at this
level.
netbenefit_ creates an object to be passed into jointCovariance or
pated through its ... argument. The object defines a hierarchical
net-benefit (a.k.a. win-difference, proportion-in-favor) statistic
across a list of endpoints, each declared by nb_tte(),
nb_continuous(), or nb_binary().
netbenefit_(formula, endpoints, data_index = 1)netbenefit_(formula, endpoints, data_index = 1)
formula |
a two-sided R formula |
endpoints |
a non-empty list of endpoint specs built by |
data_index |
integer. Index of the data frame in the |
The estimator is
where , , and are the numbers of treatment
wins, losses, and overall ties across all pairs
(control vs. treatment subject). The per-subject influence function is
available in closed form, so both the asymptotic and the bootstrap paths
of jointCovariance are supported.
The arm reference level is inferred from the arm column the same way
model.matrix(~ arm) would: levels(arm)[1] for factor, the smaller
value for numeric or logical, and the alphabetically first value for
character. To override, convert the column to a factor with the desired
level order before calling netbenefit_().
An object of class c("jc_spec_netbenefit", "jc_spec").
nb_tte(), nb_continuous(), nb_binary(), jointCovariance(),
pated().
pated is a wrapper function of jointCovariance for testing treatment effect
in randomized clinical trials. It assumes that prognostic variables are fully
randomized. This assumption can help enhancing statistical power of conventional
approaches in detecting the treatment effect. Specifically, the sensitivity
of the conventional models specified in ... are improved by pated.
pated( ..., data, nboot = 0, compute_cov = TRUE, seed = NULL, transform = "identity" )pated( ..., data, nboot = 0, compute_cov = TRUE, seed = NULL, transform = "identity" )
... |
model specifications built by |
data |
either a single data frame (when all models are fitted on
the same dataset) or a list of data frames (one entry per |
nboot |
non-zero integer if bootstrap is adopted. By default 0. |
compute_cov |
logic. If |
seed |
random seed when generate bootstrap data. |
transform |
character. Now only supports |
a data frame of testing results.
## More examples can be found in the vignettes. library(survival) library(mvtnorm) genData <- function(seed = NULL){ set.seed(seed) n <- 300 sigma <- matrix(c(1, .6, .6, 1), 2) x <- rmvnorm(n, sigma = sigma) z1 <- rbinom(n, 1, .6) z2 <- rnorm(n) trt <- rbinom(n, 1, .5) bet <- c(-.2, .2) y <- -.5 + x %*% bet + z1 * .3 - z2 * .1 + .1 * trt - .1 * rnorm(n) death <- rbinom(n, 1, .8) data.frame( y = as.numeric(y), trt = trt, z1 = z1, z2 = z2, x1 = x[, 1], x2 = x[, 2], death, pid = paste0('s-', seq_len(n)) ) } dat <- genData(seed = 31415926) ## `data_index` defaults to 1 in every spec constructor and a single ## data.frame is auto-wrapped into a list, so neither needs spelling out ## when all models are fitted on the same dataset. fit <- pated( coxph_(Surv(time = y, event = death) ~ trt), glm_(z1 ~ trt, family = 'binomial'), glm_(z2 ~ trt, family = 'gaussian'), glm_(x1 ~ trt, family = 'gaussian'), glm_(x2 ~ trt, family = 'gaussian'), data = dat ) fit## More examples can be found in the vignettes. library(survival) library(mvtnorm) genData <- function(seed = NULL){ set.seed(seed) n <- 300 sigma <- matrix(c(1, .6, .6, 1), 2) x <- rmvnorm(n, sigma = sigma) z1 <- rbinom(n, 1, .6) z2 <- rnorm(n) trt <- rbinom(n, 1, .5) bet <- c(-.2, .2) y <- -.5 + x %*% bet + z1 * .3 - z2 * .1 + .1 * trt - .1 * rnorm(n) death <- rbinom(n, 1, .8) data.frame( y = as.numeric(y), trt = trt, z1 = z1, z2 = z2, x1 = x[, 1], x2 = x[, 2], death, pid = paste0('s-', seq_len(n)) ) } dat <- genData(seed = 31415926) ## `data_index` defaults to 1 in every spec constructor and a single ## data.frame is auto-wrapped into a list, so neither needs spelling out ## when all models are fitted on the same dataset. fit <- pated( coxph_(Surv(time = y, event = death) ~ trt), glm_(z1 ~ trt, family = 'binomial'), glm_(z2 ~ trt, family = 'gaussian'), glm_(x1 ~ trt, family = 'gaussian'), glm_(x2 ~ trt, family = 'gaussian'), data = dat ) fit
Plot PATED Analysis Results
## S3 method for class 'pated' plot(x, ...)## S3 method for class 'pated' plot(x, ...)
x |
an object returned from |
... |
currently not supported. |
NULL
Summarize an analysis of multiple outcomes.
## S3 method for class 'summary.jointCovariance' print(x, ...)## S3 method for class 'summary.jointCovariance' print(x, ...)
x |
an object returned by |
... |
for debugging only. |
an invisible object.
## no example## no example
quantile_ is a wrapper function creating an object that, for each
requested probability, computes the difference between the two arms'
sample quantiles of the outcome. The object is passed to jointCovariance
or pated through .... Because the empirical-quantile estimator has no
tractable closed-form score, this engine is available only through the
bootstrap path (nboot > 0).
quantile_(formula, probs = c(0.25, 0.5, 0.75), data_index = 1)quantile_(formula, probs = c(0.25, 0.5, 0.75), data_index = 1)
formula |
a two-sided formula |
probs |
numeric vector of probabilities in |
data_index |
integer. Index of the data frame in the |
simulateMoData generates data for simulation and testing purposes.
simulateMoData(n = 500, hr = 0.8, seed = NULL)simulateMoData(n = 500, hr = 0.8, seed = NULL)
n |
an integer for total sample size of a randomized control trial of two arms. |
hr |
hazard ratio of treatment. |
seed |
random seed. By default |
summary method for class jointCovariance.
## S3 method for class 'jointCovariance' summary(object, model_index = NULL, ...)## S3 method for class 'jointCovariance' summary(object, model_index = NULL, ...)
object |
an object returned by |
model_index |
|
... |
for debugging only |
a list
Returns the variance-covariance matrix of the main parameters of fitted model
objects. The "main" parameters of models correspond to those returned by coef.
## S3 method for class 'jointCovariance' vcov(object, model_index = NULL, ...)## S3 method for class 'jointCovariance' vcov(object, model_index = NULL, ...)
object |
an object returned by |
model_index |
|
... |
for debugging only |
a matrix of covariance of all estimates