MultAddHaz: Fit Multinomial Additive Hazard Models

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function fits multinomial additive hazard models subject to linear inequality constraints using the function constrOptim in the stats package for multinomial (multi-category) outcomes. It also calculates the cause-specific contributions to the disability prevalence for each category of the response variable based on the extension of the attribution method, as proposed by Yokota et al (2017).

Usage

1
2
3
4
5
MultAddHaz(formula, data, subset, weights, na.action, model = TRUE,
           contrasts = NULL, start, attrib = TRUE, attrib.var,
           collapse.background = FALSE, attrib.disease = FALSE,
           type.attrib = "abs", seed, bootstrap = FALSE, conf.level = 0.95,
           nbootstrap, parallel = FALSE, type.parallel = "snow", ncpus = 4,...)

Arguments

formula

a formula expression of the form response ~ predictors, similar to other regression models. In case of attrib = TRUE, the first predictor in the formula should be the attrib.var. See example.

data

an optional data frame or matrix containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which MultAddHaz is called.

subset

an optional vector specifying a subset of observations to be used in the fitting process. All observations are included by default.

weights

an optional vector of survey weights to be used in the fitting process.

na.action

a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The 'factory-fresh' default is na.omit.

model

logical. If TRUE, the model frame is included as a component of the returned object.

contrasts

an optional list to be used for some or all of the factors appearing as variables in the model formula.

start

an optional vector of starting values. If not provided by the user, it is randomly generated.

attrib

logical. Should the attribution of chronic diseases/conditions for each disability level be estimated? Default is TRUE.

attrib.var

character indicating the name of the attribution variable to be used if attrib = TRUE. If missing, the attribution results will not be stratified by the levels of the attribution variable. The attribution variable must be the first variable included in the linear predictor in formula. See example.

collapse.background

logical. Should the background be collapsed across the levels of the attrib.var for each disability level? If FALSE, the background will be estimated for each level of the attrib.var. If TRUE, only one background will be estimated. If TRUE, attrib.var must be specified. Default is FALSE.

attrib.disease

logical. Should the attribution of diseases be stratified by the levels of the attribution variable for each disability level? If FALSE, the attribution of diseases will not be stratified by the levels of the attrib.var. If TRUE, the attribution of diseases will be estimated for each level of the attrib.var. If TRUE, interaction between diseases and the attribution variable must be provided in the formula. Default is FALSE.

type.attrib

type of attribution to be estimated. The options are "abs" for absolute contribution, "rel" for relative contribution, or "both" for both absolute and relative contributions. Default is "abs".

seed

integer indicating the random seed.

bootstrap

logical. Should bootstrap percentile confidence intervals be estimated for the model parameters and attributions? Default is FALSE. See details.

conf.level

scalar containing the confidence level of the bootstrap percentile confidence intervals. Default is 0.95.

nbootstrap

integer. Number of bootstrap replicates.

parallel

logical. Should parallel calculations be used to obtain the bootstrap percentile confidence intervals? Default is FALSE.

type.parallel

type of parallel operation to be used (if parallel = TRUE), with options: "multicore" and "snow". Default is "snow". See details.

ncpus

integer. Number of processes to be used in the parallel operation: typically one would choose this to be the number of available CPUs. Default is 4.

...

other arguments passed to or from the other functions.

Details

The model is a generalized linear model with a non-canonical link function, which requires a restriction on the linear predictor (η ≥ 0) to produce valid probabilities. This restriction is implemented in the optimization procedure, with an adaptive barrier algorithm, using the function constrOptim in the stats package.

The variance-covariance matrix is based on the observed information matrix.

This version of the package only allows the calculation of non-parametric bootstrap percentile confidence intervals (CI). Stratified bootstrap is applied to each category of the outcome. Also, the function gives the user the option to do parallel calculation of the bootstrap CI. The snow parallel option is available for all operating systems (Windows, Linux, and Mac OS) while the multicore option is only available for Linux and Mac OS systems. These two calculations are done by calling the boot function in the boot package. For more details see the documentation of the boot package.

More information about the multinomial additive hazard model and the estimation of the contribution of chronic conditions to the disability prevalence can be found in the references.

Value

A list with arguments:

coefficients

column matrix with the regression coefficients.

ci

matrix with confidence intervals calculated via bootstraping (if bootstrap = TRUE) or as the inverse of the observed information matrix.

resDeviance

residual deviance.

df

degrees of freedom.

pvalue

column matrix of p-values based on the Wald test. Only provided if bootstrap = FALSE.

stdError

column matrix with the standard errors for the parameter estimates based on the inverse of the observed information matrix. Only provided if bootstrap = FALSE.

vcov

variance-covariance matrix (inverse of the observed information matrix). Only provided if bootstrap = FALSE.

contribution

for type.attrib = "abs" or "rel", a matrix is provided. For type.attrib = "both", a list with two matrices ("abs" and "rel") is provided. This represents the contribution of each predictor in the model (usually diseases) to the disability prevalence. Percentile bootstrap confidence intervals are provided if bootstrap = TRUE. If attrib = FALSE, it returns a logical, FALSE.

bootsRep

matrix with the bootstrap replicates of the regression coefficients and contributions (if attrib = TRUE).

conf.level

confidence level of the bootstrap CI. Only provided if bootstrap = TRUE.

bootstrap

logical. Was bootstrap CI requested?

call

the matched call.

Author(s)

Renata T. C. Yokota. This function is based on the R code developed by Caspar W. N. Looman and Wilma J. Nusselder for the binomial additive hazard model with modifications and adaptations for the multinomial case.

References

Yokota, R.T.C., Van Oyen, H., Looman, C.W.N., Nusselder, W.J., Otava, M., Kifle, Y.W., Molenberghs, G. (2017). Multinomial additive hazard model to assess the disability burden using cross-sectional data. Biometrical Journal, 59(5), 901-917.

See Also

BinAddHaz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  data(disabData)

  ## Model without bootstrap CI and no attribution
## Not run: 
  fit1 <- MultAddHaz(dis.mult ~ diab + arth + stro , data = disabData, weights = wgt,
                     attrib = FALSE)
  summary(fit1)

  ## Model with bootstrap CI and attribution without stratification, no parallel calculation
  # Warning message due to the low number of bootstrap replicates

  fit2 <- MultAddHaz(dis.mult ~ diab + arth + stro , data = disabData, weights = wgt,
                     attrib = TRUE, collapse.background = FALSE, attrib.disease = FALSE,
                     type.attrib = "both", seed = 111, bootstrap = TRUE, conf.level = 0.95,
                     nbootstrap = 5)
  summary(fit2)

  ## Model with bootstrap CI and attribution of diseases and background stratified by
  ## age, with parallel calculation of bootstrap CI
  # Warning message due to the low number of bootstrap replicates

  diseases <- as.matrix(disabData[,c("diab", "arth", "stro")])
  fit3 <- MultAddHaz(dis.mult ~ factor(age) -1 + diseases: factor(age), data = disabData,
                     weights = wgt, attrib = TRUE, attrib.var = age,
                     collapse.background = FALSE, attrib.disease = TRUE, type.attrib = "both",
                     seed = 111, bootstrap = TRUE, conf.level = 0.95, nbootstrap = 5,
                     parallel = TRUE, type.parallel = "snow", ncpus = 4)

  summary(fit3)
## End(Not run)

addhaz documentation built on May 1, 2019, 7:29 p.m.

Related to MultAddHaz in addhaz...