{"id":32204495,"url":"https://github.com/mjg211/ph2rand","last_synced_at":"2025-10-22T04:57:52.663Z","repository":{"id":56935173,"uuid":"190286420","full_name":"mjg211/ph2rand","owner":"mjg211","description":"Development version of ph2rand, an R package for the design of randomized comparative phase II oncology trials","archived":false,"fork":false,"pushed_at":"2021-03-01T13:39:39.000Z","size":18796,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-22T04:57:22.149Z","etag":null,"topics":["adaptive-design","bernard","bernoulli","binary","binomial","cancer","clinical-trials","drug-development","exact","fisher","minimax","oncology","optimal","phase-2","power","sample-size","type-i"],"latest_commit_sha":null,"homepage":"https://mjg211.github.io/ph2rand","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjg211.png","metadata":{"files":{"readme":"README.Rmd","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}},"created_at":"2019-06-04T22:11:54.000Z","updated_at":"2021-03-01T13:39:41.000Z","dependencies_parsed_at":"2022-08-21T06:50:46.008Z","dependency_job_id":null,"html_url":"https://github.com/mjg211/ph2rand","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mjg211/ph2rand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjg211%2Fph2rand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjg211%2Fph2rand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjg211%2Fph2rand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjg211%2Fph2rand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjg211","download_url":"https://codeload.github.com/mjg211/ph2rand/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjg211%2Fph2rand/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280382997,"owners_count":26321423,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["adaptive-design","bernard","bernoulli","binary","binomial","cancer","clinical-trials","drug-development","exact","fisher","minimax","oncology","optimal","phase-2","power","sample-size","type-i"],"created_at":"2025-10-22T04:57:48.111Z","updated_at":"2025-10-22T04:57:52.658Z","avatar_url":"https://github.com/mjg211.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n```{r, echo = F}\nsuppressPackageStartupMessages(library(ph2rand))\n```\n\n# ph2rand \u003cimg src='man/figures/ph2rand.png' align=\"right\" height=\"139\" /\u003e\n\n*Randomized Phase II Oncology Trials with Bernoulli Outcomes*\n\n## Description\n\n__ph2rand__ provides functions to assist with the design of randomized comparative phase II oncology trials that assume their primary outcome variable is Bernoulli distributed.\nSpecifically, support is provided to (a) perform a sample size calculation when using one of several published designs (Jung, 2008; Jung and Sargent, 2014; Kepner, 2010; Litwin *et al*, 2017, Shan *et al*, 2013), (b) evaluate the operating characteristics of a given design (both analytically and via simulation), and (c) produce informative plots.\n\n## Getting started\n\nYou can install the the latest development version of __ph2rand__, available from [GitHub](https://github.com/), with\n\n```{r, eval = F}\ndevtools::install_github(\"mjg211/ph2rand\")\n```\n\nAn introductory example of how to make use of the package’s core functionality can be found below.\nFor further help, please see the package vignettes or email michael.grayling@newcastle.ac.uk.\n\n## Example: Two-stage designs\n\nWe demonstrate functionality for two-stage designs, with the approach for single-stage designs being similar.\nFirst, find a two-stage design from Jung (2008) for the default parameters\n\n```{r binomial}\ndes_jung \u003c- des_two_stage()\n```\n\nThen examine its required sample size in each arm, in each stage\n\n```{r binomial_samplesize}\ndes_jung$nC\ndes_jung$nE\n```\n\nNext, look at its key operating characteristics\n\n```{r binomial_opchar}\ndes_jung$opchar\n```\n\nCompare this to the equivalent design from Litwin *et al* (2017)\n\n```{r sat}\ndes_litwin_et_al \u003c- des_two_stage(type  = \"sat\",\n                                  nCmax = 20L)\ndes_litwin_et_al$nC\ndes_litwin_et_al$nE\ndes_litwin_et_al$opchar\n```\n\nNow to that from Shan (2013)\n\n```{r barnard}\ndes_shan_et_al \u003c- des_two_stage(type  = \"barnard\",\n                                nCmax = 40L)\ndes_shan_et_al$nC\ndes_shan_et_al$nE\ndes_shan_et_al$opchar\n```\n\nAnd finally that from Jung and Sargent (2014)\n\n```{r fisher}\ndes_jung_sargent \u003c- des_two_stage(type  = \"fisher\")\ndes_jung_sargent$nC\ndes_jung_sargent$nE\ndes_jung_sargent$opchar\n```\n\nWe can then readily find the terminal points of any of these designs, along with their probability mass functions and operating characteristics for any true response rates.\nFor example, consider two scenarios given by\n\n```{r pi}\npi \u003c- rbind(c(0.1, 0.1),\n            c(0.1, 0.3))\n```\n\nThen find the terminal points, probability mass functions, and operating characteristics (both analytically and via simulation) of the Jung (2008) design with\n\n```{r terminal_pmf_opchar}\nterminal_jung \u003c- terminal(des_jung)\nterminal_jung$terminal\npmf_jung      \u003c- pmf(des_jung, pi)\npmf_jung$pmf\nopchar_jung   \u003c- opchar(des_jung, pi)\nopchar_jung$opchar\nsim_jung      \u003c- sim(des_jung, pi)\nsim_jung$sim\n```\n\nFinally, we can plot various factors relating to the designs.\nFor example, plot the terminal points of the Jung (2008) design (with their associated decisions), along with the probability of rejecting the null hypothesis when the response probabilities are equal in the two arms or when the difference in the response probabilities is the chosen treatment effect\n\n```{r plot}\nplot(des_jung)\n```\n\nSee the package vignettes for further details.\n\n## References\n\nJung SH (2008) Randomized phase II trials with a prospective control.\n*Stat Med* 27(4):568--83.\nDOI: [10.1002/sim.2961](https://doi.org/10.1002/sim.2961).\nPMID: [17573688](https://pubmed.ncbi.nlm.nih.gov/17573688).\n\nJung SH, Sargent DJ (2014) Randomized phase II clinical trials.\n*J Biopharm Stat* 24(4):802--16.\nDOI: [10.1080/10543406.2014.901343](https://doi.org/10.1080/10543406.2014.901343).\nPMID: [24697589](https://pubmed.ncbi.nlm.nih.gov/24697589).\n\nKepner JL (2010) On group sequential designs comparing two binomial proportions.\n*J Biopharm Stat* 20(1):145--59.\nDOI: [10.1080/10543400903280621](https://doi.org/10.1080/10543400903280621).\nPMID: [20077254](https://pubmed.ncbi.nlm.nih.gov/20077254).\n\nLitwin S, Basickes S, Ross EA (2017) Two-sample binary phase 2 trials with low type I error and low sample size.\n*Stat Med* 36(9):1383--94.\nDOI: [10.1002/sim.7226](https://doi.org/10.1002/sim.7226).\nPMID: [28118686](https://pubmed.ncbi.nlm.nih.gov/28118686).\n\nShan G, Ma C, Hutson AD, Wilding GE (2013) Randomized two-stage phase II clinical trial designs based on Barnard's exact test.\n*J Biopharm Stat* 23(5):1081--90.\nDOI: [10.1080/10543406.2013.813525](https://doi.org/10.1080/10543406.2013.813525).\nPMID: [23957517](https://pubmed.ncbi.nlm.nih.gov/23957517).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjg211%2Fph2rand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjg211%2Fph2rand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjg211%2Fph2rand/lists"}