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.
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
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
Statistics
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
rcens Package
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) ```

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
- Repositories: 18
- Profile: https://github.com/dlsaavedra
GitHub Events
Total
- Watch event: 1
- Push event: 1
Last Year
- Watch event: 1
- Push event: 1
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel Saavedra | d****a@u****l | 31 |
Committer Domains (Top 20 + Academic)
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
- Homepage: https://github.com/dlsaavedra/rcens
- Documentation: http://cran.r-project.org/web/packages/rcens/rcens.pdf
- License: MIT + file LICENSE
-
Latest release: 0.1.1
published about 2 years ago