{"id":21310431,"url":"https://github.com/ocbe-uio/psbcspeedup","last_synced_at":"2025-07-11T23:31:44.732Z","repository":{"id":195235046,"uuid":"692518069","full_name":"ocbe-uio/psbcSpeedUp","owner":"ocbe-uio","description":"Penalized Semiparametric Bayesian Cox Models","archived":false,"fork":false,"pushed_at":"2024-03-21T22:30:44.000Z","size":786,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-24T19:32:25.575Z","etag":null,"topics":["bayesian-cox-models","omics-data","survival-analysis"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocbe-uio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-16T18:13:32.000Z","updated_at":"2024-06-20T02:25:58.105Z","dependencies_parsed_at":null,"dependency_job_id":"e19cd466-8c2d-4772-a316-a7a8dd8a8dbc","html_url":"https://github.com/ocbe-uio/psbcSpeedUp","commit_stats":null,"previous_names":["ocbe-uio/psbcspeedup"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocbe-uio%2FpsbcSpeedUp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocbe-uio%2FpsbcSpeedUp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocbe-uio%2FpsbcSpeedUp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocbe-uio%2FpsbcSpeedUp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocbe-uio","download_url":"https://codeload.github.com/ocbe-uio/psbcSpeedUp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225769345,"owners_count":17521258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-cox-models","omics-data","survival-analysis"],"created_at":"2024-11-21T17:13:32.973Z","updated_at":"2024-11-21T17:13:33.649Z","avatar_url":"https://github.com/ocbe-uio.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# psbcSpeedUp\n\n[![CRAN](http://www.r-pkg.org/badges/version/psbcSpeedUp)](https://cran.r-project.org/package=psbcSpeedUp)\n[![r-universe](https://ocbe-uio.r-universe.dev/badges/psbcSpeedUp)](https://ocbe-uio.r-universe.dev/psbcSpeedUp)\n[![R-CMD-check](https://github.com/ocbe-uio/psbcSpeedUp/workflows/R-CMD-check/badge.svg)](https://github.com/ocbe-uio/psbcSpeedUp/actions)\n[![License](https://img.shields.io/badge/License-GPLv3-brightgreen.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![DOI](https://img.shields.io/badge/doi-10.32614%2FCRAN.package.psbcSpeedUp-brightgreen)](https://doi.org/10.32614/CRAN.package.psbcSpeedUp)\n\nThis is a C++ speed-up and extended version of the R-pakcage [psbcGroup](https://CRAN.R-project.org/package=psbcGroup).\nIt implements the Bayesian Lasso Cox model ([Lee et al., 2011](https://doi.org/10.2202/1557-4679.1301)) and the Bayesian Lasso Cox with mandatory variables ([Zucknick et al., 2015](https://doi.org/10.1002/bimj.201400160)).\nBayesian Lasso Cox models with other shrinkage and group priors ([Lee et al., 2015](https://doi.org/10.1002/sam.11266)) are to be implemented later on.\n\n## Installation\n\nInstall the latest released version from [CRAN](https://CRAN.R-project.org/package=psbcSpeedUp)\n\n```r\ninstall.packages(\"psbcSpeedUp\")\n```\n\nInstall the latest development version from GitHub\n\n```r\n#install.packages(\"remotes\")\nremotes::install_github(\"ocbe-uio/psbcSpeedUp\")\n```\n\n## Examples\n\n### Run a Bayesian Lasso Cox with mandatory variables\n\nData set `exampleData` consists of six components:\nsurvival times `t`,\nevent status `di`,\ncovariates `x`,\nnumber of genomics variables `p`,\nnumber of clinical variables `q` and\ntrue effects of covariates `beta_true`.\nSee `?exampleData` for more information of the data.\n\nTo run a Bayesian Lasso Cox model for variable selection of the first $p$ genomics variables and inclusion of $q$ mandatory variables, one can specify arguments of the main function `psbcSpeedUp()` with `p = p` and `q = q`.\nIf the arguments `p` and `q` are unspecified, the Bayesian Lasso Cox model does variable selection for all covariates, i.e., by default `p = ncol(survObj$x)` and `q = 0`.\n\n```r\n# Load the example dataset\ndata(\"exampleData\", package = \"psbcSpeedUp\")\np \u003c- exampleData$p\nq \u003c- exampleData$q\nsurvObj \u003c- exampleData[1:3]\n\n# Set hyperparameters (see help file for specifying more hyperparameters)\nmypriorPara \u003c- list('eta0'=0.02, 'kappa0'=1, 'c0'=2, 'r'=10/9, 'delta'=1e-05,\n'lambdaSq'=1, 'sigmaSq'= runif(1, 0.1, 10), 'beta.prop.var'=1, 'beta.clin.var'=1)\n\n# run Bayesian Lasso Cox\nlibrary(\"psbcSpeedUp\")\nset.seed(123)\nfitBayesCox \u003c- psbcSpeedUp(survObj, p=p, q=q, hyperpar=mypriorPara,\nnIter=1000, burnin=500, outFilePath=\"/tmp\")\n```\n\n```\nRunning MCMC iterations ...\n[##################################################] 100%\nDONE, exiting!\n```\n\n### Plot posterior estimates of regression cofficients\n\nThe function `psbcSpeedUp::plot()` can show the posterior mean and 95% credible intervals of regression coefficients.\n\n```r\nplot(fitBayesCox)\n```\n\n\u003cimg src=\"man/figures/README_plot_beta.png\" width=\"70%\" /\u003e\n\n\n### Plot time-dependent Brier scores\n\nThe function `psbcSpeedUp::plotBrier()` can show the time-dependent Brier scores based on posterior mean of coefficients or Bayesian model averaging.\n\n```r\nplotBrier(fitBayesCox, times = 80)\n```\n```\n    Null.model Bayesian.Cox\nIBS  0.2089742     0.109274\n```\n\n\u003cimg src=\"man/figures/README_plot_brier.png\" width=\"80%\" /\u003e\n\n\n### Predict survival probabilities and cumulative hazards\n\nThe function `psbcSpeedUp::predict()` can estimate the survival probabilities and cumulative hazards.\n\n```r\npredict(fitBayesCox, type = c(\"cumhazard\", \"survival\"))\n```\n```\n##        observation   times cumhazard  survival\n##     1:           1   0.264  1.08e-05  1.00e+00\n##     2:           2   0.264  4.50e-05  1.00e+00\n##     3:           3   0.264  5.33e-05  1.00e+00\n##     4:           4   0.264  1.84e-05  1.00e+00\n##     5:           5   0.264  7.22e-05  1.00e+00\n##    ---                                        \n## 39996:         196 107.641  2.66e+00  6.97e-02\n## 39997:         197 107.641  5.47e-01  5.79e-01\n## 39998:         198 107.641  5.15e+01  4.41e-23\n## 39999:         199 107.641  4.13e+02 5.72e-180\n## 40000:         200 107.641  2.24e-01  7.99e-01\n```\n\n\n## References\n\n\u003e Kyu Ha Lee, Sounak Chakraborty, Jianguo Sun (2011).\n\u003e Bayesian variable selection in semiparametric proportional hazards model for high dimensional survival data.\n\u003e _The International Journal of Biostatistics_, 7:1. DOI: [10.2202/1557-4679.1301](https://doi.org/10.2202/1557-4679.1301).\n\n\u003e Kyu Ha Lee, Sounak Chakraborty, Jianguo Sun (2015).\n\u003e Survival prediction and variable selection with simultaneous shrinkage and grouping priors.\n\u003e _Statistical Analysis and Data Mining_, 8:114-127. DOI:[10.1002/sam.11266](https://doi.org/10.1002/sam.11266).\n\n\u003e Manuela Zucknick, Maral Saadati, Axel Benner (2015).\n\u003e Nonidentical twins: Comparison of frequentist and Bayesian lasso for Cox models.\n\u003e _Biometrical Journal_, 57:959-981. DOI:[10.1002/bimj.201400160](https://doi.org/10.1002/bimj.201400160).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focbe-uio%2Fpsbcspeedup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focbe-uio%2Fpsbcspeedup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focbe-uio%2Fpsbcspeedup/lists"}