| subtype | R Documentation | 
Fitting a Cox proportional hazard model for competing risks data, in which marker variables define the subyptes of outcome.
subtype(formula, data, id, 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)
| formula | a formula object with an obect of the type  | 
| data | a data.frame which has variables in formula and markers. | 
| id | a charhacter string specifying subject IDs. | 
| 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  | 
| first_cont_rr | a logical value: if  | 
| second_cont_bl | a logical value: if  | 
| second_cont_rr | a logical value: if  | 
| 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  | 
| init | a vector of initial values of the iteration. Default value is zero for all variables. | 
| control | an object of class  | 
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.
This is a wrapper function for coxph after data duplication. The returned value x, y are duplicated the number of subtypes of outcome. +cluster() should be avoided since we automatically include it in the formula.
For marker variables, 0 indicates censored events.
A returned object is an object of class coxph. See coxph.object for details. The additional returned values include the following:
| basehaz | estimated baseline cause-specific hazard functions the reference disease subtype corresponding to marker variables equal to 1. | 
| subtype | a list of values related to subtypes including the number of subtypes, character strings of marker names, etc. | 
m1 <- subtype(Surv(start, time, status)~ X + W,  data = data, id = "id", marker_name = c("y1", "y2"), second_cont_bl = FALSE, second_cont_rr = FALSE, constvar = "W")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.