AIPWsubtype: Augmented inverse probability weighted Cox proportional...

View source: R/AIPWsubtype.R

AIPWsubtypeR Documentation

Augmented inverse probability weighted Cox proportional hazard model for competing risks data

Description

Fitting an augmented inverse probability weighted Cox proportional hazard model for competing risks data with partially missing markers, in which marker variables define the subyptes of outcome.

Usage

AIPWsubtype(formula, data, id, missing_model = c("condi", "multinom"),
  missing_formula, missing_indep = FALSE, two_stage = FALSE,
  tstage_name = NULL, marker_name, marker_rr = NULL,
  first_cont_rr = TRUE, second_cont_bl = FALSE,
  second_cont_rr = FALSE, constvar = NULL, init, control, x = FALSE,
  y = TRUE, model = FALSE)

Arguments

formula

a formula object with an obect of the type Surv on the left side and the terms on the right side. It should not include marker variables.

data

a data.frame which has variables in formula and markers.

id

a charhacter string specifying subject IDs.

missing_model

a character string specifying the approach of the missingness model.missing_model = "condi" represents the conditional approach and missing_model = "multinom" uses a multinomial model.

missing_formula

a list of the missingness model formula for each marker. A right side of formula object including a ~ operator. If two_stage is TRUE, a model for the first-stage missingness model should be included at the last element of a list.

missing_indep

a logical value: if TRUE, markers are assumed to be independent.

two_stage

a logical value: if TRUE, a two-stage missingness model is used. Default is FALSE.

tstage_name

a charhacter string specifying the first-stage missingness variable if two_stage is TRUE.

marker_name

a vector of charhacter strings specifying markers defining cause of failures.

marker_rr

a vector of logical value. Dafault is NULL, in which a model includes all markers named in marker_name in modeling heterogeneity effects. Otherwise, a vector of logical value can spcify whether each marker's heterogeneity effect will be examined or not. A length of this should be equal to that of marker_name.

first_cont_rr

a logical value: if TRUE, the first order contrasts are included in modeling cause-specific relative risks based on log-linear representation. Otherwise the first contrasts are only included.

second_cont_bl

a logical value: if TRUE, the second order contrasts are included in modeling cause-specific baseline functions based on log-linear representation. Otherwise the first contrasts are only included.

second_cont_rr

a logical value: if TRUE, the second order contrasts are included in modeling cause-specific relative risks based on log-linear representation. Otherwise the first contrasts are only included.

constvar

a vector of character strings specifying constrained varaibles of which the effects on the outcome are to be the same across subtypes of outcome. The variables which are not specified in constvar are considered as unconstrained variabales of which the associations with the outcome may be different across the outcome subtypes.

init

a vector of initial values of the iteration. Default value is zero for all variables.

control

an object of class coxph.control in survival packages.The default value of iter.max is 2000 and that of eps is 1e-12. See coxph.control for other values.

Details

The Cox proportional hazard model is used to model cause-specific hazard functions. To examine the association between exposures and the specific subtypes of disease, the log-linear is used for reparameterization. Logistic regression models glm are used for the missiness models and a conditional logistic regression model clogit is used for the marker model. The data duplication method is used so that the returned value x and y are duplicated the number of subtypes of outcome. Special terms including +strata() and +offset() can be used. +cluster() should be avoided since we automatically include it in the formula. Breslow method is used for handling tied event times. The first order contrasts are included as default in modeling cause-specific baseline functions based on log-linear representation.

For marker variables, 0 indicates censored events or missing values. formula = formula, call = Call, terms = Terms, assign = assign, method = "AIPW"

Value

An object of class AIPWsubtype representing the fit.

coefficients

the estimated regressoin coefficients.

naive.var

the inverse of estimated Information matrix.

var

the robust sandwich variance estimate.

linear.predictors

a vector of linear predictors. This is not centered.

loglik

a vector of length 2 containing the log-likelihood with the initial values and with the estimated coefficients.

score

a value of the score test at the initial value of the coefficients.

rscore

a value of the robust log-rank statistic.

wald.test

a value of the Wald test statistics for whether the estimated coefficients are different from the initial value of the coefficients.

score.residual

the score residuals for each subject.

iter

a number of iterations used.

conv

an integer code for the convergence. 0 indicates successful convergence, 1 indicates a failure to convergence, and 2 indicates it reaches the maximum number of iterations.

basehaz

estimated baseline cause-specific hazard functions the reference disease subtype corresponding to marker variables equal to 1.

Ithealp

a matrix of the partial derivative of the score functions with respect to the parameters from the missingness models.

Ithegam

a matrix of the partial derivative of the score functions with respect to the parameters from the marker model.

model.missing

a list of an object of class glm fitting the missingness models.

model.subtype

an object of class clogit fitting the marker model.

n

the number of observations.

nevent

the number of events.

subtype

a list of values related to subtypes including the number of subtypes, character strings of marker names, etc.

The object will also contain the following: strata, formula, call, terms, y, xlevels, offset, optionally x, and model.

Examples

m1 <- AIPWsubtype(Surv(start, time, status)~ X + W,  data = data, id = "id", missing_model = "multinom",  missing_formula = list(~time + X, ~time + X),
 two_stage = FALSE, marker_name = c("y1", "y2"), second_cont_bl = FALSE, second_cont_rr = FALSE, constvar = "W")

# Two-stage missingness model
m2 <- AIPWsubtype(Surv(start, time, status)~ X + W,  data = data, id = "id", missing_model = "multinom", missing_formula = list(~time + X, ~time + X, ~time + X + W),
 two_stage = TRUE, tstage_name = c("R0"), marker_name = c("y1", "y2"), second_cont_bl = FALSE, second_cont_rr = FALSE, constvar = "W")



joolee0918/AIPWsubtype documentation built on Feb. 29, 2024, 5:03 p.m.