# Analysis of Multivariate Event Times

## Documentation for package ‘mets’ version 1.3.7

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Code demos. Use demo() to run them.
- Package NEWS.

## Help Pages

A B C D E F G H I J K L M N O P R S T V W misc

## -- A --

aalenfrailty | Aalen frailty model
aalenMets | Fast additive hazards model with robust standard errors
ace.family.design | For internal use
ACTG175 | ACTG175, block randmized study from speff2trial package
addCums | Simulation of Piecewise constant hazard model (Cox).
alpha2kendall | For internal use
alpha2spear | For internal use
as.character.Event | Event history object
as.matrix.Event | Event history object
ascertained.pairs | For internal use

## -- B --

back2timereg | Convert to timereg object
basecumhaz | Plotting the baselines of stratified Cox
basehazplot.phreg | Plotting the baselines of stratified Cox
basehazplotO.phreg | Plotting the baselines of stratified Cox
baseplot | Plotting the baselines of stratified Cox
bicomprisk | Estimation of concordance in bivariate competing risks data
bicompriskData | Estimation of concordance in bivariate competing risks data
BinAugmentCifstrata | Augmentation for Binomial regression based on stratified NPMLE Cif (Aalen-Johansen)
binomial.twostage | Fits Clayton-Oakes or bivariate Plackett (OR) models for binary data using marginals that are on logistic form. If clusters contain more than two times, the algoritm uses a compososite likelihood based on all pairwise bivariate models.
binomial.twostage.time | Fits Clayton-Oakes or bivariate Plackett (OR) models for binary data using marginals that are on logistic form. If clusters contain more than two times, the algoritm uses a compososite likelihood based on all pairwise bivariate models.
binreg | Binomial Regression for censored competing risks data
binregATE | Average Treatment effect for censored competing risks data using Binomial Regression
binregCasewise | Estimates the casewise concordance based on Concordance and marginal estimate using binreg
binregG | G-estimator for binomial regression model (Standardized estimates)
binregRatio | Percentage of years lost due to cause regression
binregt | Binomial Regression for censored competing risks data
binregTSR | 2 Stage Randomization for Survival Data or competing Risks Data
biprobit | Bivariate Probit model
biprobit.time | Bivariate Probit model
biprobit.vector | Bivariate Probit model
blocksample | Block sampling
bmt | The Bone Marrow Transplant Data
BootmediatorSurv | Mediation analysis in survival context
Bootphreg | Wild bootstrap for Cox PH regression
bplot | Plotting the baselines of stratified Cox
bplotdFG | Double CIF Fine-Gray model with two causes
bptwin | Liability model for twin data
bptwin.time | Liability model for twin data

## -- C --

calgb8923 | CALGB 8923, twostage randomization SMART design
casewise | Estimates the casewise concordance based on Concordance and marginal estimate using prodlim but no testing
casewise.bin | Estimates the casewise concordance based on Concordance and marginal estimate using timereg and performs test for independence
casewise.test | Estimates the casewise concordance based on Concordance and marginal estimate using timereg and performs test for independence
cause.pchazard.sim | Simulation of Piecewise constant hazard models with two causes (Cox).
CCbinomial.twostage | For internal use
cif | Cumulative incidence with robust standard errors
cif.yearslost | Restricted mean for stratified Kaplan-Meier or Cox model with martingale standard errors
cifreg | CIF regression
cifregFG | CIF regression
ClaytonOakes | Clayton-Oakes model with piece-wise constant hazards
cluster.index | Finds subjects related to same cluster
coarse.clust | For internal use
coefmat | For internal use
concordance.cor | Concordance Computes concordance and casewise concordance
concordanceCor | Concordance Computes concordance and casewise concordance
concordanceTwinACE | For internal use
concordanceTwostage | For internal use
conftype | Fast Cox PH regression
construct_id | Fast Cox PH regression
cor.cif | Cross-odds-ratio, OR or RR risk regression for competing risks
corsim.prostate | For internal use
corsim.prostate.random | For internal use
count.history | Counts the number of previous events of two types for recurrent events processes
count.historyVar | Counts the number of previous events of two types for recurrent events processes
countID | Finds subjects related to same cluster
covfr | Predictions from proportional hazards model
covfridstrata | Predictions from proportional hazards model
covfridstrataCov | Predictions from proportional hazards model
covIntH1dM1IntH2dM2 | Simulation of recurrent events data based on cumulative hazards with two types of recurrent events
CPH_HPN_CRBSI | Rates for HPN program for patients of Copenhagen Cohort
cpred | Fast approximation
cumContr | GOF for Cox covariates in PH regression
cumoddsreg | Discrete time to event interval censored data
cumsum2strata | Predictions from proportional hazards model
cumsumidstratasum | Predictions from proportional hazards model
cumsumidstratasumCov | Predictions from proportional hazards model
cumsumstrata | Predictions from proportional hazards model
cumsumstratasum | Predictions from proportional hazards model

## -- D --

daggr | aggregating for for data frames
daggregate | aggregating for for data frames
Dbvn | Derivatives of the bivariate normal cumulative distribution function
dby | Calculate summary statistics grouped by
dby2 | Calculate summary statistics grouped by
dby2<- | Calculate summary statistics grouped by
dby<- | Calculate summary statistics grouped by
dbyr | Calculate summary statistics grouped by
dcor | summary, tables, and correlations for data frames
dcount | summary, tables, and correlations for data frames
dcut | Cutting, sorting, rm (removing), rename for data frames
dcut<- | Cutting, sorting, rm (removing), rename for data frames
ddrop | Cutting, sorting, rm (removing), rename for data frames
ddrop<- | Cutting, sorting, rm (removing), rename for data frames
dermalridges | Dermal ridges data (families)
dermalridgesMZ | Dermal ridges data (monozygotic twins)
deval | summary, tables, and correlations for data frames
deval2 | summary, tables, and correlations for data frames
dfactor | relev levels for data frames
dfactor<- | relev levels for data frames
dhead | list, head, print, tail
diabetes | The Diabetic Retinopathy Data
diffstrata | CIF regression
dInterval | Discrete time to event interval censored data
divide.conquer | Split a data set and run function
divide.conquer.timereg | Split a data set and run function from timereg and aggregate
dkeep | Cutting, sorting, rm (removing), rename for data frames
dkeep<- | Cutting, sorting, rm (removing), rename for data frames
dlag | Lag operator
dlag<- | Lag operator
dlev | relev levels for data frames
dlev<- | relev levels for data frames
dlevel | relev levels for data frames
dlevel<- | relev levels for data frames
dlevels | relev levels for data frames
dlist | list, head, print, tail
dmean | summary, tables, and correlations for data frames
dmeansd | summary, tables, and correlations for data frames
dmvn | Multivariate normal distribution function
dnames | Cutting, sorting, rm (removing), rename for data frames
dnames<- | Cutting, sorting, rm (removing), rename for data frames
dnumeric | relev levels for data frames
dnumeric<- | relev levels for data frames
doubleFGR | Double CIF Fine-Gray model with two causes
dprint | list, head, print, tail
dquantile | summary, tables, and correlations for data frames
dreg | Regression for data frames with dutility call
drelev | relev levels for data frames
drelev<- | relev levels for data frames
drelevel | relev levels for data frames
drelevel<- | relev levels for data frames
drename | Cutting, sorting, rm (removing), rename for data frames
drename<- | Cutting, sorting, rm (removing), rename for data frames
dreshape | Fast reshape
drm | Cutting, sorting, rm (removing), rename for data frames
drm<- | Cutting, sorting, rm (removing), rename for data frames
drop.specials | For internal use
drop.strata | Augmentation for Fine-Gray model based on stratified NPMLE Cif (Aalen-Johansen)
dsample | Block sampling
dscalar | summary, tables, and correlations for data frames
dsd | summary, tables, and correlations for data frames
dsort | Sort data frame
dsort2 | Sort data frame
dsort<- | Sort data frame
dspline | Simple linear spline
dspline<- | Simple linear spline
dstr | summary, tables, and correlations for data frames
dsubset | summary, tables, and correlations for data frames
dsum | summary, tables, and correlations for data frames
dsummary | summary, tables, and correlations for data frames
dtab | tables for data frames
dtable | tables for data frames
dtail | list, head, print, tail
dtrans | Transform that allows condition
dtrans<- | Transform that allows condition
dtransform | Transform that allows condition
dtransform<- | Transform that allows condition
dunique | Cutting, sorting, rm (removing), rename for data frames

## -- E --

easy.binomial.twostage | Fits two-stage binomial for describing depdendence in binomial data using marginals that are on logistic form using the binomial.twostage funcion, but call is different and easier and the data manipulation is build into the function. Useful in particular for family design data.
Effbinreg | Efficient IPCW for binary data
EVaddGam | Relative risk for additive gamma model
evalTerminal | Evaluates piece constant covariates at min(D,t) where D is a terminal event
Event | Event history object
event.split | event.split (SurvSplit).
eventpois | Extract survival estimates from lifetable analysis
EventSplit2 | Event split with two time-scales, time and gaptime
extendCums | Simulation of illness-death model

## -- F --

familycluster.index | Finds all pairs within a cluster (family)
familyclusterWithProbands.index | Finds all pairs within a cluster (famly) with the proband (case/control)
fast.approx | Fast approximation
fast.cluster | For internal use
fast.pattern | Fast pattern
fast.reshape | Fast reshape
FastCoxPLstrataR | Fast Cox PH regression and calculations done in R to make play and adjustments easy
faster.reshape | For internal use
FGprediid | CIF regression
FG_AugmentCifstrata | Augmentation for Fine-Gray model based on stratified NPMLE Cif (Aalen-Johansen)
folds | For internal use
force.same.cens | For internal use
format.Event | Event history object

## -- G --

glm_IPTW | IPTW GLM, Inverse Probaibilty of Treatment Weighted GLM
GLprediid | Recurrent events regression with terminal event
gof.phreg | GOF for Cox PH regression
gofFG | CIF regression
gofG.phreg | Stratified baseline graphical GOF test for Cox covariates in PH regression
gofM.phreg | GOF for Cox covariates in PH regression
gofZ.phreg | GOF for Cox covariates in PH regression
Grandom.cif | Additive Random effects model for competing risks data for polygenetic modelling
grouptable | For internal use

## -- H --

haplo | haplo fun data
haplo.surv.discrete | Discrete time to event haplo type analysis
headstrata | Predictions from proportional hazards model
hfactioncpx12 | hfaction, subset of block randmized study HF-ACtion from WA package

## -- I --

iidBaseline | Influence functions or IID decomposition of baseline for recrec/phreg/cifregFG
IIDrecreg | Recurrent events regression with terminal event
ilap | For internal use
indexstrata | Fast approximation
indexstratarightR | CIF regression
Interval | Discrete time to event interval censored data
interval.logitsurv.discrete | Discrete time to event interval censored data
invsubdist | Simulation of output from Cumulative incidence regression model
ipw | Inverse Probability of Censoring Weights
ipw2 | Inverse Probability of Censoring Weights

## -- J --

jumptimes | For internal use

## -- K --

kendall.ClaytonOakes.twin.ace | For internal use
kendall.normal.twin.ace | For internal use
km | Kaplan-Meier with robust standard errors
kmplot | Plotting the baselines of stratified Cox
kumarsim | Average Treatment effect for censored competing risks data using Binomial Regression
kumarsimRCT | Average Treatment effect for censored competing risks data using Binomial Regression

## -- L --

lifecourse | Life-course plot
lifetable | Life table
lifetable.formula | Life table
lifetable.matrix | Life table
lin.approx | Simulation of Piecewise constant hazard model (Cox).
LinSpline | Simple linear spline
logitATE | Average Treatment effect for censored competing risks data using Binomial Regression
logitIPCW | Binomial Regression for censored competing risks data
logitIPCWATE | Average Treatment effect for censored competing risks data using Binomial Regression
logitSurv | Proportional odds survival model
loglikMVN | Multivariate normal distribution function

## -- M --

make.pairwise.design | For internal use
make.pairwise.design.competing | For internal use
matdoubleindex | Predictions from proportional hazards model
matplot.mets.twostage | For internal use
mdi | Predictions from proportional hazards model
mediatorSurv | Mediation analysis in survival context
medweight | Computes mediation weights
melanoma | The Melanoma Survival Data
mena | Menarche data set
mets.options | Set global options for 'mets'
migr | Migraine data
mlogit | Multinomial regression based on phreg regression
multcif | Multivariate Cumulative Incidence Function example data set
mystrata | Finds subjects related to same cluster
mystrata2index | Finds subjects related to same cluster

## -- N --

namesortme | Fast Cox PH regression
nonparcuminc | For internal use
normalATE | Average Treatment effect for censored competing risks data using Binomial Regression
np | np data set
npc | For internal use

## -- O --

object.defined | For internal use
or.cif | Cross-odds-ratio, OR or RR risk regression for competing risks
or2prob | Estimate parameters from odds-ratio

## -- P --

p11.binomial.twostage.RV | For internal use
pairRisk | Finds subjects related to same cluster
pbvn | Multivariate normal distribution function
pcif | Extract survival estimates from lifetable analysis
phreg | Fast Cox PH regression
phreg.par | Fast Cox PH regression
phregR | Fast Cox PH regression and calculations done in R to make play and adjustments easy
phreg_IPTW | IPTW Cox, Inverse Probaibilty of Treatment Weighted Cox regression
phreg_rct | Lu-Tsiatis More Efficient Log-Rank for Randomized studies with baseline covariates
piecewise.data | For internal use
piecewise.twostage | For internal use
plack.cif | plack Computes concordance for or.cif based model, that is Plackett random effects model
plack.cif2 | plack Computes concordance for or.cif based model, that is Plackett random effects model
plot.phreg | Plotting the baselines of stratified Cox
plotConfRegion | Plotting the baselines of stratified Cox
plotConfregion | Plotting the baselines of stratified Cox
plotConfRegionSE | Plotting the baselines of stratified Cox
plotcr | For internal use
plotO.predictphreg | Fast Cox PH regression
plotpredictphreg | Fast Cox PH regression
plotstrata | Plotting the baselines of stratified Cox
plotSurvd | Discrete time to event interval censored data
plot_twin | Scatter plot function
pmvn | Multivariate normal distribution function
ppch | Piecewise constant hazard distribution
pre.cifs | Simulation of output from Cumulative incidence regression model
pred.cif.boot | Wild bootstrap for Cox PH regression
predict | Multinomial regression based on phreg regression
predict.phreg | Predictions from proportional hazards model
predictCumhaz | Fast approximation
predictdFG | Double CIF Fine-Gray model with two causes
predictGLM | Reporting OR (exp(coef)) from glm with binomial link and glm predictions
predictlogitSurvd | Discrete time to event interval censored data
predictO.phreg | Fast Cox PH regression
predictPairPlack | For internal use
predictrecreg | Fast Cox PH regression
predictRisk | Risk predictions to work with riskRegression package
predictRisk.binreg | Risk predictions to work with riskRegression package
predictRisk.cifreg | Risk predictions to work with riskRegression package
predictRisk.cifregFG | Risk predictions to work with riskRegression package
predictRisk.phreg | Risk predictions to work with riskRegression package
predictRisk.recreg | Risk predictions to work with riskRegression package
predictSurvd | Discrete time to event interval censored data
predicttime | Recurrent events regression with terminal event
print.casewise | prints Concordance test
print.Event | Event history object
prob.exceed.recurrent | Estimation of probability of more that k events for recurrent events process
prob.exceedBiRecurrent | Estimation of probability of more that k events for recurrent events process
prob.exceedBiRecurrentStrata | Estimation of probability of more that k events for recurrent events process
prob.exceedRecurrent | Estimation of probability of more that k events for recurrent events process
prob.exceedRecurrentStrata | Estimation of probability of more that k events for recurrent events process
procform | For internal use
procform3 | For internal use
procformdata | For internal use
prt | Prostate data set

## -- R --

random.cif | Random effects model for competing risks data
randomDes | Twostage survival model for multivariate survival data
ratioATE | Average Treatment effect for Restricted Mean for censored competing risks data using IPCW
rbind.Event | Event history object
rchaz | Simulation of Piecewise constant hazard model (Cox).
rchazC | Piecewise constant hazard distribution
rchazl | Simulation of Piecewise constant hazard models with two causes (Cox).
rcrisk | Simulation of Piecewise constant hazard models with two causes (Cox).
rcrisks | Simulation of Piecewise constant hazard models with two causes (Cox).
read.fit | Simulation of output from Cox model.
read.phreg | Simulation of output from Cox model.
readmargsurv | Twostage survival model for multivariate survival data
readPhreg | Fast Cox PH regression
recmarg | Fast recurrent marginal mean when death is possible
recreg | Recurrent events regression with terminal event
recregIPCW | Recurrent events regression with terminal event
recurrentMarginal | Fast recurrent marginal mean when death is possible
recurrentMarginalAIPCW | Fast recurrent marginal mean when death is possible
recurrentMarginalPhreg | Fast recurrent marginal mean when death is possible
resmean.phreg | Restricted mean for stratified Kaplan-Meier or Cox model with martingale standard errors
resmeanATE | Average Treatment effect for Restricted Mean for censored competing risks data using IPCW
resmeanIPCW | Restricted IPCW mean for censored survival data
resmeanIPCWold | Restricted IPCW mean for censored survival data
revcumsum | Predictions from proportional hazards model
revcumsum2strata | Predictions from proportional hazards model
revcumsum2stratafdN | Predictions from proportional hazards model
revcumsumidstratasum | Predictions from proportional hazards model
revcumsumidstratasumCov | Predictions from proportional hazards model
revcumsumstrata | Predictions from proportional hazards model
revcumsumstratasum | Predictions from proportional hazards model
rmst.phreg | Restricted mean for stratified Kaplan-Meier or Cox model with martingale standard errors
rmstATE | Average Treatment effect for Restricted Mean for censored competing risks data using IPCW
rmstIPCW | Restricted IPCW mean for censored survival data
rmstRatio | Percentage of years lost due to cause regression
rmvn | Multivariate normal distribution function
robust.basehaz.phreg | Predictions from proportional hazards model
robust.phreg | Fast Cox PH regression
rpch | Piecewise constant hazard distribution
rr.cif | Cross-odds-ratio, OR or RR risk regression for competing risks

## -- S --

scalecumhaz | Recurrent events regression with terminal event
scoreMVN | Multivariate normal distribution function
setup.cif | Augmentation for Fine-Gray model based on stratified NPMLE Cif (Aalen-Johansen)
setup.phreg | Simulation of output from Cox model.
showfitsim | Simulation of recurrent events data based on cumulative hazards with two types of recurrent events
showfitsimList | Simulation of recurrent events data based on cumulative hazards with two types of recurrent events
sim | For internal use
sim.base | Simulation of output from Cox model.
sim.cause.cox | Simulation of cause specific from Cox models.
sim.cif | Simulation of output from Cumulative incidence regression model
sim.cifs | Simulation of output from Cumulative incidence regression model
sim.cifsRestrict | Simulation of output from Cumulative incidence regression model
sim.cox | Simulation of output from Cox model.
sim.phreg | Simulation of output from Cox model.
sim.phregs | Simulation of output from Cox model.
sim.recurrent | Simulation of two-stage recurrent events data based on Cox/Cox or Cox/Ghosh-Lin structure
simAalenFrailty | Simulate from the Aalen Frailty model
simbinClaytonOakes.family.ace | For internal use
simbinClaytonOakes.pairs | For internal use
simbinClaytonOakes.twin.ace | For internal use
simBinFam | For internal use
simBinFam2 | For internal use
simBinPlack | For internal use
simCens | Simulation of Piecewise constant hazard model (Cox).
simClaytonOakes | Simulate from the Clayton-Oakes frailty model
simClaytonOakes.family.ace | For internal use
simClaytonOakes.twin.ace | For internal use
simClaytonOakesLam | Simulate from the Clayton-Oakes frailty model
simClaytonOakesWei | Simulate from the Clayton-Oakes frailty model
simCompete.simple | For internal use
simCompete.twin.ace | For internal use
simCox | For internal use
simFrailty.simple | For internal use
simGLcox | Simulation of two-stage recurrent events data based on Cox/Cox or Cox/Ghosh-Lin structure
simlogitSurvd | Discrete time to event interval censored data
simMultistate | Simulation of illness-death model
simnordic | For internal use
simnordic.random | For internal use
simrchaz | Simulation of Piecewise constant hazard model (Cox).
simRecurrent | Simulation of recurrent events data based on cumulative hazards with two types of recurrent events
simRecurrentII | Simulation of recurrent events data based on cumulative hazards with two types of recurrent events
simRecurrentList | Simulation of recurrent events data based on cumulative hazards with two types of recurrent events
simRecurrentTS | Simulation of recurrent events data based on cumulative hazards: Two-stage model
simsubdist | Simulation of output from Cumulative incidence regression model
simSurvFam | For internal use
simTTP | Discrete time to event interval censored data
simul.cifs | Augmentation for Fine-Gray model based on stratified NPMLE Cif (Aalen-Johansen)
simulate.cox | Simulation of output from Cox model.
slope.process | Estimates the casewise concordance based on Concordance and marginal estimate using timereg and performs test for independence
squareintHdM | Simulation of recurrent events data based on cumulative hazards with two types of recurrent events
sTRACE | The TRACE study group of myocardial infarction
strataAugment | Recurrent events regression with terminal event
strataC | Augmentation for Fine-Gray model based on stratified NPMLE Cif (Aalen-Johansen)
subdist | Simulation of output from Cumulative incidence regression model
summary.cor | Summary for dependence models for competing risks
summary.Event | Event history object
summarybase.phreg | Fast Cox PH regression
summaryGLM | Reporting OR (exp(coef)) from glm with binomial link and glm predictions
summaryRecurrentobject | Estimation of probability of more that k events for recurrent events process
summaryTimeobject | Estimation of probability of more that k events for recurrent events process
sumstrata | Predictions from proportional hazards model
surv.boxarea | For internal use
survival.twostage | Twostage survival model for multivariate survival data
survivalG | G-estimator for Cox and Fine-Gray model
survivalGtime | G-estimator for Cox and Fine-Gray model

## -- T --

tailstrata | Predictions from proportional hazards model
test.conc | Concordance test Compares two concordance estimates
tetrachoric | Estimate parameters from odds-ratio
tie.breaker | Fast recurrent marginal mean when death is possible
TRACE | The TRACE study group of myocardial infarction
ttpd | ttpd discrete survival data on interval form
tTRACE | The TRACE study group of myocardial infarction
twin.clustertrunc | Estimation of twostage model with cluster truncation in bivariate situation
twin.polygen.design | For internal use
twinbmi | BMI data set
twinlm | Classic twin model for quantitative traits
twinlm.strata | Classic twin model for quantitative traits
twinlm.time | Liability model for twin data
twinsim | Simulate twin data
twinstut | Stutter data set
twostage.aalen | Twostage survival model for multivariate survival data
twostage.cox.aalen | Twostage survival model for multivariate survival data
twostage.coxph | Twostage survival model for multivariate survival data
twostage.phreg | Twostage survival model for multivariate survival data
twostageMLE | Twostage survival model fitted by pseudo MLE
twostageREC | Recurrent events regression with terminal event

## -- V --

vecAllStrata | CIF regression

## -- W --

WA_recurrent | While-Alive estimands for recurrent events

## -- misc --

[.Event | Event history object