IPWsubtype: Inverse probability weighted Cox proportional hazard model...

View source: R/IPWsubtype.R

IPWsubtypeR Documentation

Inverse probability weighted Cox proportional hazard model for competing risks data

Description

Fitting an 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

IPWsubtype(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 with weights 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. The weights for the complete cases are obtained by fitting logistic regression models glm. The data duplication method is used so that the returned value x, y, and weights 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.

For marker variables, 0 indicates censored events or missing values.

Value

An object of class IPWsubtype 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.

score.residual

the score residuals for each subject. For incomplece cases, the value is 0.

iter

a number of iterations used.

weights

a vector of weights used, which is the inverse of the probability of complete case given the event occurs.

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.

model.missing

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

n

the number of observations.

nc

the number of complete-case observations.

nevent

the number of events.

ncevent

the number of complete-case 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, offset, xlevels, optionally x, and model.

Examples

m1 <- IPWsubtype(Surv(start, time, status)~ X + W,  data = data, id = "id", 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 <- IPWsubtype(Surv(start, time, status)~ X + W,  data = data, id = "id", 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.