cotram {cotram}R Documentation

Count Transformation Models

Description

Likelihood-based count transformation models for fully parameterised discrete conditional distribution functions. The link function governing the interpretation of the predictor can be chosen and results in discrete hazard ratios, odds ratios, reverse time hazard ratios or conditional expectation of transformed counts.

Usage

cotram(formula, data, method = c("logit", "cloglog", "loglog", "probit"),
       log_first = TRUE, prob = 0.9, subset, weights, offset, cluster,
       na.action = na.omit, ...)

Arguments

formula

an object of class "formula": a symbolic description of the model structure to be fitted. The details of model specification are given under tram and in the package vignette.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula).

method

character specifying the choice of the link function, mapping the transformation function into probabilities. Available choices include the logit, complementary log-log, log-log or probit link. The different link functions govern the interpretation of the linear predictor. Details of the interpretation can be found in the package vignette.

prob

probability giving the quantile of the response defining the upper limit of the support of a smooth Bernstein polynomial (with the lower limit being set to 0). If a vector of two probabilites is specified, the corresponding quantiles of the response define the lower and upper limit of the support, respectively. Note, that the support is rounded to integer values.

log_first

logical; if TRUE, a Bernstein polynomial is defined on the log-scale for (y + 1).

subset

an optional vector specifying a subset of observations to be used in the fitting process.

weights

an optional vector of weights to be used in the fitting process. Should be NULL or a numeric vector. If present, the weighted log-likelihood is maximised.

offset

this can be used to specify an _a priori_ known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases.

cluster

optional factor with a cluster ID employed for computing clustered covariances.

na.action

a function which indicates what should happen when the data contain NAs. The default is set to na.omit.

...

additional arguments to tram.

Details

Likelihood-based estimation of a fully parameterised conditional discrete distribution function for count data, while ensuring interpretability of the linear predictors. The models are defined with a negative shift term relating positive predictors to larger values of the conditional mean. For the model with logistic or cloglog link exp(-coef()) is the multiplicative change of discrete odds-ratios or hazard ratios. For the model with loglog link exp(coef()) is the multiplicative change of the reverse time hazard ratios. Applying a transformation model with probit link coef() gives the conditional expectation of the transformed counts, with transformation function estimated from data.

Value

An object of class cotram and tram, with corresponding coef, vcov, logLik, summary, print, plot and predict methods.

References

Sandra Siegfried, Torsten Hothorn (2020), Count Transformation Models, Methods in Ecology and Evolution, 11(7), 818–827, doi:10.1111/2041-210X.13383.

Torsten Hothorn, Lisa Möst, Peter Bühlmann (2018), Most Likely Transformations, Scandinavian Journal of Statistics, 45(1), 110–134, doi:10.1111/sjos.12291.

Torsten Hothorn (2020), Most Likely Transformations: The mlt Package, Journal of Statistical Software, 92(1), 1–68, doi:10.18637/jss.v092.i01.

Examples


  op <- options(digits = 2)

  data("birds", package = "TH.data")
  cotram(SG5 ~ AOT + AFS + GST + DBH + DWC + LOG, data = birds)

  options(op)


[Package cotram version 0.5-1 Index]