Type: | Package |
Title: | Survival Analysis using Time Dependent Covariate for Animal Breeding |
Version: | 0.1.0 |
Author: | Dr. Himadri Ghosh [aut, cre], Mr. Saikath Das [aut], Dr. Md Yeasin [aut], Dr. Amrit Kumar Paul [aut] |
Maintainer: | Dr. Himadri Ghosh <hghosh@gmail.com> |
Description: | Survival analysis is employed to model the time it takes for events to occur. Survival model examines the relationship between survival and one or more predictors, usually termed covariates in the survival-analysis literature. To this end, Cox-proportional (Cox-PH) hazard rate model introduced in a seminal paper by Cox (1972) <doi:10.1111/j.2517-6161.1972.tb00899.x>, is a broadly applicable and the most widely used method of survival analysis. This package can be used to estimate the effect of fixed and time-dependent covariates and also to compute the survival probabilities of the lactation of dairy animal. This package has been developed using algorithm of Klein and Moeschberger (2003) <doi:10.1007/b97377>. |
License: | GPL-3 |
Encoding: | UTF-8 |
Imports: | stats, survival, readxl |
RoxygenNote: | 7.2.3 |
NeedsCompilation: | no |
Packaged: | 2023-01-11 13:22:50 UTC; YEASIN |
Depends: | R (≥ 3.5.0) |
Repository: | CRAN |
Date/Publication: | 2023-01-12 18:40:08 UTC |
Cox-PH Model for Animal Breeding
Description
Data preparation for ABCoxPH
Usage
ABCoxPH(wide_data, lact)
Arguments
wide_data |
Dataset from DataPrep function |
lact |
Number of lactation to be used for model building |
Value
Cox_Model - ABCoxPH 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("ABSurvTDC")
library("readxl")
data_test<-read_excel(path = system.file("extdata/data_test.xlsx", package = "ABSurvTDC"))
PropData<-DataPrep(data =as.data.frame(data_test))
ABCoxPH(PropData)
ABCoxPH Prediction
Description
Prediction for ABCoxPH model
Usage
CoxPred(Model, NewData, AFC, HYS)
Arguments
Model |
ABCoxPH model |
NewData |
New data |
AFC |
Age (in days) at first calving |
HYS |
Combine effect of herd, year and season |
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("ABSurvTDC")
library("readxl")
data_test<-read_excel(path = system.file("extdata/data_test.xlsx", package = "ABSurvTDC"))
PropData<-DataPrep(data =as.data.frame(data_test))
model<-ABCoxPH(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)
HYS<-2033
AFC <- 1400
CoxPred(Model=model, NewData=ndata, AFC, HYS)
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("ABSurvTDC")
library("readxl")
data_test<-read_excel(path = system.file("extdata/data_test.xlsx", package = "ABSurvTDC"))
PropData<-DataPrep(data =as.data.frame(data_test))