rcens

The "rcens" package provides functions to generate censored samples of type I, II and III, from any random sample generator. It also provides the option to create left and right censorship. Along with this, the generation of samples with interval censoring is in the testing phase. With two options of fixed length intervals and random lengths.

https://github.com/dlsaavedra/rcens

Science Score: 13.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
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.6%) to scientific vocabulary

Keywords

censored-data r simulation statistics
Last synced: 9 months ago · JSON representation

Repository

The "rcens" package provides functions to generate censored samples of type I, II and III, from any random sample generator. It also provides the option to create left and right censorship. Along with this, the generation of samples with interval censoring is in the testing phase. With two options of fixed length intervals and random lengths.

Basic Info
  • Host: GitHub
  • Owner: dlsaavedra
  • License: other
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 1.93 MB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
censored-data r simulation statistics
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

rcens Package

Hits

This package provides functions to generate censored samples of type I, II and III, from any random sample generator. It also provides the option to create left and right censorship Along with this, the generation of samples with interval censoring is in the testing phase. With two options of fixed length intervals and random lengths.

Installation

You can install rcens from CRAN via:

r install.packages("rcens")

Or install the latest development version (on GitHub) via {devtools}:

r devtools::install_github("dlsaavedra/rcens")

Getting Started

Create easily a new censored data set establishment the percentage of censoring and the original distribution of random variable.

Right Censored Data, type III (Random)

In this example create a right censored data type III and fit Kaplan Meier (survival library).

``` r

Example Exponential - Uniform

devtools::install_github("dlsaavedra/rcens") library(rcens) library(survival)

Data = rcensT3(rdistrX = rexp, pdistrC = punif, rdistrC = runif, paramX = list("rate" = 2), paramC = list("min" = 0, "max" = "lambda"), n = 1e02, theta = .5, right = TRUE)

S = Surv(Data$samplecensored,Data$censoredindicator, type = "right") s1 = survfit(S ~ 1)

CDFcensored = ecdf(Data$samplecensored) SurvivalCDF = Vectorize(function(x){ 1 - CDFcensored(x)}) CDForiginal= ecdf(Data$sampleuncensored) SurvivalCDForiginal = Vectorize(function(x){ 1 - CDF_original(x)})

plot(SurvivalCDF, col = "blue", xlim = c(0,2)) title("Survival Curve") plot(SurvivalCDForiginal, col = "red", add= TRUE, xlim = c(0,2)) lines(s1$time, s1$surv, col = "green", xlim = c(0,2)) legend("topright",c("original","censured", "SurvivalKM"), col = c("red", "blue", "green"), lty = 1) ```

<https://github.com/dlsaavedra/rcens/blob/main/image/Survival_Curve_Example_rcensT3.png>

Other Examples

In the folder examples_plot you can find example for each function in this packages.

Citation

To cite rcens in publication use:

Saavedra D, Ramos PL (2024). rcens: Generate Sample Censoring. R package version 0.1.0, https://github.com/dlsaavedra/rcens.

A BibTeX entry for LaTeX users is:

bibtex @Manual{, title = {rcens: Generate Sample Censoring}, author = {Daniel Saavedra and Pedro L Ramos}, year = {2024}, note = {R package version 0.1.1}, url = {https://github.com/dlsaavedra/rcens}, }

Future Work

We are currently working to generate data with interval right censoring, both with fixed and random interval length. Soon we will propose a function to generate data with double interval censoring. All this while maintaining the possibility of using any distribution for the original data.

Owner

  • Name: Daniel Saavedra
  • Login: dlsaavedra
  • Kind: user
  • Company: Pontificia Universidad Católica de Chile

GitHub Events

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

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 31
  • Total Committers: 1
  • Avg Commits per committer: 31.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 31
  • Committers: 1
  • Avg Commits per committer: 31.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Daniel Saavedra d****a@u****l 31
Committer Domains (Top 20 + Academic)
uc.cl: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 553 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: rcens

Generate Sample Censoring

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

Dependencies

DESCRIPTION cran