| Type: | Package |
| Title: | Cox Regression (Proportional Hazards Model) with Multiple Causes and Mixed Effects |
| Version: | 1.5.6 |
| Date: | 2025-11-18 |
| Maintainer: | Jing Peng <pengjing@live.com> |
| Description: | Extends the Cox model to events with more than one causes. Also supports random and fixed effects, tied events, and time-varying variables. Model details are provided in Peng et al. (2018) <doi:10.1509/jmr.14.0643>. |
| License: | GPL (≥ 3) |
| Encoding: | UTF-8 |
| Depends: | R (≥ 3.1.0), Rcpp (≥ 0.12.0) |
| Imports: | utils, methods, data.table |
| LinkingTo: | Rcpp, RcppArmadillo |
| NeedsCompilation: | yes |
| RoxygenNote: | 7.3.3 |
| Packaged: | 2025-11-19 00:37:53 UTC; pengj |
| Author: | Jing Peng [aut, cre] |
| Repository: | CRAN |
| Date/Publication: | 2025-11-19 08:10:24 UTC |
CoxPlus: Cox Regression with Multiple Causes and Mixed Effects
Description
CoxPlus is a high performance package for estimating Proportional Hazards Models when an event can have more than one cause. It includes support for random and fixed effects, tied events, and time-varying variables.
Cox Regression (Proportional Hazards Model) with Multiple Causes and Mixed Effects
Description
This function estimates Proportional Hazards Model when an even can have more than one causes, including support for random and fixed effects, tied events, and time-varying variables.
Usage
fastCox(head, formula, par = list(), data = NULL)
Arguments
head |
A data frame with 4~5 columns: start, stop, event, weight, strata (optional). |
formula |
A formula specifying the independent variables |
par |
A optional list of parameters controlling the estimation process |
data |
The dataset, a data frame containing observations on the independent variables |
Value
A list containing the estimated parameters
References
1. Jing Peng, Ashish Agarwal, Kartik Hosanagar, and Raghuram Iyengar. (2018). Network Overlap and Content Sharing on Social Media Platforms. Journal of Marketing Research, 55(4), p. 571-585.
2. Jing Peng, Ashish Agarwal, Kartik Hosanagar, and Raghuram Iyengar. Toward Effective Social Contagion: A Micro Level Analysis of the Impact of Dyadic Network Relationship. In Proceedings of the 2014 International Conference on Information Systems.
Examples
# Simulate a dataset. lam=exp(x), suvtime depends on lam
set.seed(123)
x = rnorm(5000)
suvtime = -log(runif(length(x)))/exp(x)
# Censor 80% of events
thd = quantile(suvtime, 0.2)
event = as.numeric(suvtime <= thd)
suvtime[suvtime>thd] = thd
# The estimates of beta should be very close to 1, the true value
head = cbind(start=0,stop=suvtime,event=event,weight=1)
est = fastCox(head,~x)
print(est$result)