| Title: | Survival Analysis using Indicators under Time Dependent Covariates |
|---|---|
| Description: | Survival analysis is employed to model time-to-event data. This package examines the relationship between survival and one or more predictors, termed as covariates, which can include both treatment variables (e.g., season of birth, represented by indicator functions) and continuous variables. To this end, the Cox-proportional hazard (Cox-PH) model, introduced by Cox in 1972, is a widely applicable and commonly used method for survival analysis. This package enables the estimation of the effect of randomization for the treatment variable to account for potential confounders, providing adjustment when estimating the association with exposure. It accommodates both fixed and time-dependent covariates and computes survival probabilities for lactation periods in dairy animals. The package is built upon the algorithm developed by Klein and Moeschberger (2003) <DOI:10.1007/b97377>. |
| Authors: | Dr. Himadri Ghosh [aut, cre], Mr. Saikath Das [aut], Dr. Md Yeasin [aut], Dr. Debopam Rakshit [aut] |
| Maintainer: | Dr. Himadri Ghosh <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-05-23 15:11:33 UTC |
| Source: | https://github.com/cran/ExtendedABSurvTDC |
Data preparation for ABCoxPH
DataPrep(data, t_int, max_lac)DataPrep(data, t_int, max_lac)
data |
Raw data sets |
t_int |
No of days to be considered as single time interval (Default value: 90) |
max_lac |
Maximum no of lactation to be considered for data preparation (Default value: Max Lactation) |
wide_data - Processed data for ABCoxPH
J.D. Kalbfleisch and R.L. Prentice (1980). The statistical analysis of failure time data. John Wiley & Sons, Inc., New York, 1980. <doi:10.1002/9781118032985>
J.P. Klein and M L. Moeschberger (2003). Survival Analysis: Techniques for Censored and Truncated Data. Springer New York. <doi:10.1007/b97377>
library("ExtendedABSurvTDC") load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC")) PropData<-DataPrep(data =as.data.frame(data_test))library("ExtendedABSurvTDC") load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC")) PropData<-DataPrep(data =as.data.frame(data_test))
Data preparation for ABCoxPH
ExtendedABSurvTDC(wide_data, lact)ExtendedABSurvTDC(wide_data, lact)
wide_data |
Dataset from DataPrep function |
lact |
Number of lactation to be used for model building |
Cox_Model - ExtendedABCoxPH model
LongData- Long data
J.D. Kalbfleisch and R.L. Prentice (1980). The statistical analysis of failure time data. John Wiley & Sons, Inc., New York, 1980. DOI: 10.1002/9781118032985
J.P. Klein and M L. Moeschberger (2003). Survival Analysis: Techniques for Censored and Truncated Data. Springer New York, DOI:10.1007/b97377
library("ExtendedABSurvTDC") load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC")) PropData<-DataPrep(data =as.data.frame(data_test)) ExtendedABSurvTDC(PropData)library("ExtendedABSurvTDC") load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC")) PropData<-DataPrep(data =as.data.frame(data_test)) ExtendedABSurvTDC(PropData)
Prediction for ExtendedABCoxPH model
ExtendedCoxPred(Model, NewData)ExtendedCoxPred(Model, NewData)
Model |
ExtendedABCoxPH model |
NewData |
New data |
SurvProb - Survival probabilities
J.D. Kalbfleisch and R.L. Prentice (1980). The statistical analysis of failure time data. John Wiley & Sons, Inc., New York, 1980. DOI: 10.1002/9781118032985
J.P. Klein and M L. Moeschberger (2003). Survival Analysis: Techniques for Censored and Truncated Data. Springer New York, DOI:10.1007/b97377
library("ExtendedABSurvTDC") load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC")) PropData<-DataPrep(data =as.data.frame(data_test)) model<-ExtendedABSurvTDC(PropData) Lact_1<-c("Yes","Yes","Yes","No","No","No","No","No","No","No","No") Lact_2<-c("No","No","No","No","Yes","Yes","No","No","No","No","No") Lact_3<-c("No","No","No","No","No","No","No","No","Yes","Yes","Yes") Lact_4<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_5<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_6<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_7<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_8<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_9<-c("No","No","No","No","No","No","No","No","No","No","No") ndata<- data.frame(Lact_1,Lact_2,Lact_3,Lact_4,Lact_5,Lact_6,Lact_7, Lact_8,Lact_9) NewData<-ndata HYS<-2033 AFC <- 1400 Y=as.factor(1) S=as.factor(1) H=as.factor(1) NewData_default <- data.frame(AFC, Y, S, NewData) # Data for default argument of "factors" ExtendedCoxPred(Model=model, NewData=NewData_default)library("ExtendedABSurvTDC") load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC")) PropData<-DataPrep(data =as.data.frame(data_test)) model<-ExtendedABSurvTDC(PropData) Lact_1<-c("Yes","Yes","Yes","No","No","No","No","No","No","No","No") Lact_2<-c("No","No","No","No","Yes","Yes","No","No","No","No","No") Lact_3<-c("No","No","No","No","No","No","No","No","Yes","Yes","Yes") Lact_4<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_5<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_6<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_7<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_8<-c("No","No","No","No","No","No","No","No","No","No","No") Lact_9<-c("No","No","No","No","No","No","No","No","No","No","No") ndata<- data.frame(Lact_1,Lact_2,Lact_3,Lact_4,Lact_5,Lact_6,Lact_7, Lact_8,Lact_9) NewData<-ndata HYS<-2033 AFC <- 1400 Y=as.factor(1) S=as.factor(1) H=as.factor(1) NewData_default <- data.frame(AFC, Y, S, NewData) # Data for default argument of "factors" ExtendedCoxPred(Model=model, NewData=NewData_default)