transreg: Parametric regression models for infectious disease...

Description Usage Arguments Details Value Author(s) References

View source: R/transreg.R

Description

Fits accelerated failure time models for infectious disease transmission using right-censored and/or left-truncated data on contact intervals in ordered pairs of individuals and infectious contact from external sources with individuals.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
transreg(
  formula,
  sus,
  data,
  subset = NULL,
  na.action,
  dist = "weibull",
  xdist = dist,
  init = NULL,
  fixed = NULL,
  optim_method = "BFGS",
  ...
)

Arguments

formula

A formula of the form "response ~ terms". The response must be an object returned by Surv. The formula terms can include an ext term giving an external row indicator.

sus

A name (without quotes) or character string (with quotes) giving the name of the variable in data that contains the susceptible member of each pair.

data

A data frame containing the variables named in formula.

subset

An expression indicating which rows of data should be included in the model fit. In stats::model.frame, subsetting is done after evaluating the formula, which can lead to empty warnings if time == 0 or start >= stop in data rows not included in the subset. This can be avoided by subsetting the data in the data argument itself.

na.action

A missing-data filter applied to data after subset. Defaults to options()$na.action.

dist

A string partially matching a survival time distribution from transreg.distributions to specify the internal contact interval distribution. Current options are exponential (the default), weibull, and loglogistic.

xdist

A string partially matching a survival time distribution to specify the external contact interval distribution. By default, it is the same as dist.

init

A named vector of initial values for estimated coefficients.

fixed

A named vector of fixed parameter values. These can include terms in formula, intercept, logshape for the internal shape parameter, and xlogshape) for the external shape parameter.

optim_method

The method to be used by optim.

...

Further arguments to be passed to optim.

Details

Survival time distributions

Accelerated failure time models are log-linear models for the rate parameter λ in the specified survival time distribution. Each coefficient can be interpreted as the log rate ratio for a one-unit increase in the corresponding covariate, so each covariate has a multiplicative effect on the rate.

Internal and external transmission models The internal transmission model is for the hazard of transmission between individuals under observation. The external model is for hazard of transmission from external sources (e.g., the community or the environment) to individuals under observation. There are four types of covariates: internal-only, external-only, shared covariates with the same coefficients under both models, and shared covariates with (possibly) different coefficients under the two models. For covariates included in only one model, the covariate is set to zero for all data rows for the other model. Shared covariates with equal coefficients are reported as normal. Shared covariates that can have unequal coefficients are included as a shared main effect and an interaction with the external indicator variable. Thus, the main effect applies to the internal model and the main effect + interaction applies to the external model.

Value

A list with class transreg that contains the following objects:

call

The call to transreg with complete formal arguments.

coefficients

Named vector of estimated parameters.

df

The number of estimated coefficients.

dist

String naming the internal contact interval distribution.

fixed

Named vector of fixed parameter values.

init

Named vector of initial parameter values.

loglik

The maximum log likelihood.

model_matrix

The data frame used to fit the model.

nlnL

Function for calculating the negative log likelihood. See details below.

optim_method

The method used in optim.

response

The response from Surv.

sus

Factor giving the susceptible member of each ordered pair.

var

The estimated variance matrix.

xdist

String naming the external contact interval distribution; NULL if model formula has no ext term.

Author(s)

Eben Kenah kenah.1@osu.edu

References

E Kenah (2011). Contact intervals, survival analysis of epidemic data, and estimation of R_0. Biostatistics 12(3): 548-566.


ekenah/transtat documentation built on Nov. 11, 2021, 3:12 p.m.