Description Usage Arguments Details Value See Also Examples
This function performs quantile gcomputation in a survival setting. The approach estimates the covariateconditional hazard ratio for a joint change of 1 quantile in each exposure variable specified in expnms parameter
1 2 3 4 5 6 7 8 9 10 11 12 
f 
R style survival formula, which includes 
data 
data frame 
expnms 
character vector of exposures of interest 
q 
NULL or number of quantiles used to create quantile indicator variables representing the exposure variables. If NULL, then gcomp proceeds with untransformed version of exposures in the input datasets (useful if data are already transformed, or for performing standard gcomputation) 
breaks 
(optional) NULL, or a list of (equal length) numeric vectors that characterize the minimum value of each category for which to break up the variables named in expnms. This is an alternative to using 'q' to define cutpoints. 
id 
(optional) NULL, or variable name indexing individual units of observation (only needed if analyzing data with multiple observations per id/cluster) 
weights 
"case weights"  passed to the "weight" argument of

cluster 
not yet implemented 
alpha 
alpha level for confidence limit calculation 
... 
arguments to glm (e.g. family) 
For survival outcomes (as specified using methods from the survival package), this yields a conditional log hazard ratio representing a change in the expected conditional hazard (conditional on covariates) from increasing every exposure by 1 quantile. In general, this quantity quantity is not equivalent to gcomputation estimates. Hypothesis test statistics and 95% confidence intervals are based on using the delta estimate variance of a linear combination of random variables.
a qgcompfit object, which contains information about the effect measure of interest (psi) and associated variance (var.psi), as well as information on the model fit (fit) and information on the weights/standardized coefficients in the positive (pos.weights) and negative (neg.weights) directions.
qgcomp.cox.boot
, qgcomp.boot
,
and qgcomp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  set.seed(50)
N=200
dat < data.frame(time=(tmg < pmin(.1,rweibull(N, 10, 0.1))),
d=1.0*(tmg<0.1), x1=runif(N), x2=runif(N), z=runif(N))
expnms=paste0("x", 1:2)
f = survival::Surv(time, d)~x1 + x2
(fit1 < survival::coxph(f, data = dat))
(obj < qgcomp.cox.noboot(f, expnms = expnms, data = dat))
## Not run:
# weighted analysis
dat$w = runif(N)
qdata = quantize(dat, expnms=expnms)
(obj2 < qgcomp.cox.noboot(f, expnms = expnms, data = dat, weight=w))
obj2$fit
survival::coxph(f, data = qdata$data, weight=w)
# not run: bootstrapped version is much slower
(obj2 < qgcomp.cox.boot(f, expnms = expnms, data = dat, B=200, MCsize=20000))
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.