semipar.depcens

Copula Based Cox Proportional Hazards Models for Dependent Censoring

https://github.com/nago2020/semipar.depcens

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Copula Based Cox Proportional Hazards Models for Dependent Censoring

Basic Info
  • Host: GitHub
  • Owner: Nago2020
  • Language: R
  • Default Branch: master
  • Size: 96.7 KB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 1
Created over 2 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog

README.Rmd

---
output: github_document
---


```{r, include = FALSE}
knitr::opts_chunk$set(warning = FALSE,
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# SemiPar.depCens


The goal of *SemiPar.depCens* package is to provide easy to use functions in *R* for estimation of the dependent censoring methodology proposed by Deresa and Van Keilegom (2024) . The approach presented in the latter paper is based on a parametric copula for the relation between the survival time and the dependent censoring time, and the parameter defining the copula does not need to be known. Instead, the copula parameter is estimated jointly with other finite model parameters by maximizing a Pseudo likelihood function.  Available copula functions in *SemiPar.depCens* package include Frank, Gumbel and Normal copulas. Only Weibull and Lognormal models are allowed for the censoring model, even though any parametric model that satisfies certain identifiability conditions could be used.  




## Installation

The development version of *SemiPar.depCens* package is available on github. To install it in R, use:


``` r
devtools::install_github("Nago2020/SemiPar.depCens")
```



## Example

This is a basic example which shows how to use the package in practice:

```{r example}
# load packages
library(copula)
library(survival)
library(stats)
library(foreach)
library(pbivnorm)
library(SemiPar.depCens)

## load the data
data("follic")


```

```{r datatransform}

#Prepare the data in the way that is used by the package

follic = follic[order(follic$time),]                     # order the observed survival time
Z = round(follic$time,digits = 3)
d1 = as.numeric(follic$status==1)                        # censoring indicator for survival time T
d2 = as.numeric(follic$status==2)                        # censoring indicator for dependent censoring C
treat = as.numeric(follic$ch=="Y")                       # treatment indicator
age = (follic$age-mean(follic$age))/sd(follic$age)       # recommended to standardize continuous variables
hgb = (follic$hgb-mean(follic$hgb))/sd(follic$hgb)       # standardized hemoglobin
clinstg = as.numeric(follic$clinstg==1)                  # clinical stage

X = cbind(treat,age,hgb,clinstg)                         # data matrix for T, should be in matrix form
W = cbind(rep(1,length(Z)),treat,age,hgb,clinstg)        # data matrix for C, should be in matrix form
resData = data.frame("Z" = Z,"d1" = d1, "d2" = d2)       # resData should be a data frame


```

### Fit dependent censoring model

The following code fit a default copula, which is Frank, for the relation between the survival time (T) and dependent censoring time (C).  The default marginal model for C is a Weibull model. Other capabilities can be explored by typing *?fitDepCens* in the console. 

```{r fitD}

fitD <- fitDepCens(resData = resData, X = X, W = W, bootstrap = FALSE)    

```

The output for the above code chunk should look as below. Since bootstrapping = FALSE, it does not make any inference based on p-values; only parameter estimates are shown. 

```{r, fitO}
summary(fitD)
```

We can do bootstrapping by setting bootstrap = TRUE, but note that the algorithm may take long time to finish the computations, even after parallelization is used to speed up the work. The default number of bootstrap size is 50. Increasing number of bootstrap samples may produce more precise standard error estimates. 

```{r, fitB}
fitD <- fitDepCens(resData = resData,X = X, W = W, bootstrap = TRUE, n.boot = 50)    
summary(fitD)
```


### Fit independent censoring model

For independent censoring model, the assumption is that the copula parameter between T and C is zero. Hence, the model is very simplified in terms of computational costs. We obtain results very quickly in comparison to dependent censoring model. The default model for censoring distribution is Weibull. 

```{r fitI}

fitI<- fitIndepCens(resData = resData, X = X, W = W, bootstrap = TRUE, n.boot = 50)                       
summary(fitI)
```

Owner

  • Name: Negera Wakgari Deresa
  • Login: Nago2020
  • Kind: user

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
Last Year
  • Issues event: 1
  • Watch event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • cran 220 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
cran.r-project.org: SemiPar.depCens

Copula Based Cox Proportional Hazards Models for Dependent Censoring

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 220 Last month
Rankings
Dependent packages count: 28.1%
Dependent repos count: 36.1%
Average: 49.7%
Downloads: 85.0%
Maintainers (1)
Last synced: 10 months ago