Type: | Package |
Title: | Survival Analysis using Indicators under Time Dependent Covariates |
Version: | 0.1.0 |
Author: | Dr. Himadri Ghosh [aut, cre], Mr. Saikath Das [aut], Dr. Md Yeasin [aut], Dr. Debopam Rakshit [aut] |
Maintainer: | Dr. Himadri Ghosh <hghosh@gmail.com> |
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>. |
License: | GPL-3 |
Encoding: | UTF-8 |
Imports: | stats, survival, readxl |
RoxygenNote: | 7.2.1 |
NeedsCompilation: | no |
Packaged: | 2025-09-24 13:21:56 UTC; YEASIN |
Depends: | R (≥ 3.5.0) |
Repository: | CRAN |
Date/Publication: | 2025-10-01 07:10:18 UTC |
Data Preparation
Description
Data preparation for ABCoxPH
Usage
DataPrep(data, t_int, max_lac)
Arguments
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) |
Value
wide_data - Processed data for ABCoxPH
References
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>
Examples
library("ExtendedABSurvTDC")
load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC"))
PropData<-DataPrep(data =as.data.frame(data_test))
Extended Cox-PH Model for Animal Breeding
Description
Data preparation for ABCoxPH
Usage
ExtendedABSurvTDC(wide_data, lact)
Arguments
wide_data |
Dataset from DataPrep function |
lact |
Number of lactation to be used for model building |
Value
Cox_Model - ExtendedABCoxPH model
LongData- Long data
References
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
Examples
library("ExtendedABSurvTDC")
load(system.file("extdata", "data.RData", package = "ExtendedABSurvTDC"))
PropData<-DataPrep(data =as.data.frame(data_test))
ExtendedABSurvTDC(PropData)
ExtendedABCoxPH Prediction
Description
Prediction for ExtendedABCoxPH model
Usage
ExtendedCoxPred(Model, NewData)
Arguments
Model |
ExtendedABCoxPH model |
NewData |
New data |
Value
SurvProb - Survival probabilities
References
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
Examples
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)