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.
cotram(formula, data, method = c("logit", "cloglog", "loglog", "probit"),
log_first = TRUE, prob = 0.9, subset, weights, offset, cluster,
na.action = na.omit, ...)An object of class cotram and tram, with corresponding coef,
vcov, logLik, summary,
print, plot and predict methods.
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.
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).
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.
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.
logical; if TRUE, a Bernstein polynomial is
defined on the log-scale for (y + 1).
an optional vector specifying a subset of observations to be used in the fitting process.
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.
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.
optional factor with a cluster ID employed for computing clustered covariances.
a function which indicates what should happen when the data
contain NAs. The default is set to na.omit.
additional arguments to tram.
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.
Sandra Siegfried, Torsten Hothorn (2020), Count Transformation Models, Methods in Ecology and Evolution, 11(7), 818--827, tools:::Rd_expr_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, tools:::Rd_expr_doi("10.1111/sjos.12291").
Torsten Hothorn (2020), Most Likely Transformations: The mlt Package, Journal of Statistical Software, 92(1), 1--68, tools:::Rd_expr_doi("10.18637/jss.v092.i01").
op <- options(digits = 3)
data("birds", package = "TH.data")
cotram(SG5 ~ AOT + AFS + GST + DBH + DWC + LOG, data = birds)
options(op)
Run the code above in your browser using DataLab