Package: psborrow2 0.0.3.4

Matt Secrest

psborrow2: Bayesian Dynamic Borrowing Analysis and Simulation

Bayesian dynamic borrowing is an approach to incorporating external data to supplement a randomized, controlled trial analysis in which external data are incorporated in a dynamic way (e.g., based on similarity of outcomes); see Viele 2013 <doi:10.1002/pst.1589> for an overview. This package implements the hierarchical commensurate prior approach to dynamic borrowing as described in Hobbes 2011 <doi:10.1111/j.1541-0420.2011.01564.x>. There are three main functionalities. First, 'psborrow2' provides a user-friendly interface for applying dynamic borrowing on the study results handles the Markov Chain Monte Carlo sampling on behalf of the user. Second, 'psborrow2' provides a simulation framework to compare different borrowing parameters (e.g. full borrowing, no borrowing, dynamic borrowing) and other trial and borrowing characteristics (e.g. sample size, covariates) in a unified way. Third, 'psborrow2' provides a set of functions to generate data for simulation studies, and also allows the user to specify their own data generation process. This package is designed to use the sampling functions from 'cmdstanr' which can be installed from <https://stan-dev.r-universe.dev>.

Authors:Matt Secrest [aut, cre], Isaac Gravestock [aut], Craig Gower-Page [ctb], Manoj Khanal [ctb], Mingyang Shan [ctb], Kexin Jin [ctb], Zhi Yang [ctb], Genentech, Inc. [cph, fnd]

psborrow2_0.0.3.4.tar.gz
psborrow2_0.0.3.4.zip(r-4.5)psborrow2_0.0.3.4.zip(r-4.4)psborrow2_0.0.3.4.zip(r-4.3)
psborrow2_0.0.3.4.tgz(r-4.4-any)psborrow2_0.0.3.4.tgz(r-4.3-any)
psborrow2_0.0.3.4.tar.gz(r-4.5-noble)psborrow2_0.0.3.4.tar.gz(r-4.4-noble)
psborrow2_0.0.3.4.tgz(r-4.4-emscripten)psborrow2_0.0.3.4.tgz(r-4.3-emscripten)
psborrow2.pdf |psborrow2.html
psborrow2/json (API)
NEWS

# Install 'psborrow2' in R:
install.packages('psborrow2', repos = c('https://genentech.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/genentech/psborrow2/issues

Datasets:

On CRAN:

bayesian-dynamic-borrowingpsborrow2simulation-study

7.87 score 16 stars 16 scripts 481 downloads 79 exports 30 dependencies

Last updated 12 days agofrom:bd4dec0da5. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 25 2024
R-4.5-winOKOct 25 2024
R-4.5-linuxOKOct 25 2024
R-4.4-winOKOct 25 2024
R-4.4-macOKOct 25 2024
R-4.3-winOKOct 25 2024
R-4.3-macOKOct 25 2024

Exports:add_covariatesbaseline_covariatesbernoulli_priorbeta_priorbin_varbinary_cutoffborrowing_detailsborrowing_fullborrowing_hierarchical_commensurateborrowing_nonecauchy_priorcheck_cmdstancheck_cmdstanrcheck_data_matrix_has_columnscont_varcovariance_matrixcreate_analysis_objcreate_baseline_objectcreate_data_matrixcreate_data_simulationcreate_event_distcreate_simulation_objcustom_enrollmentcut_off_after_eventscut_off_after_firstcut_off_after_lastcut_off_noneenrollment_constantexp_surv_distexponential_priorgamma_priorgenerateget_cmd_stan_modelsget_dataget_quantilesget_resultsget_stan_codeget_varshalf_cauchy_priorhalf_normal_priorlogistic_bin_outcomemcmc_samplenormal_priornull_event_distoutcome_bin_logisticoutcome_cont_normaloutcome_surv_exponentialoutcome_surv_pemoutcome_surv_weibull_phplotplot_pdfplot_pmfpoisson_priorprior_bernoulliprior_betaprior_cauchyprior_exponentialprior_gammaprior_half_cauchyprior_half_normalprior_normalprior_poissonrename_draws_covariatesset_cut_offset_dropoutset_enrollmentset_transformationsshow_guidesim_borrowing_listsim_covariate_listsim_covariatessim_data_listsim_outcome_listsim_samplesizesim_treatment_listtreatment_detailsuniform_priorvariable_dictionaryweib_ph_surv_dist

Dependencies:abindbackportscheckmateclicodetoolsdigestdistributionalfansifuturegenericsglobalsgluelatticelifecyclelistenvmagrittrMatrixmatrixStatsmvtnormnumDerivparallellypillarpkgconfigposteriorrlangsimsurvtensorAtibbleutf8vctrs

Getting started with psborrow2

Rendered frompsborrow2.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-06-21
Started: 2022-09-06

Conduct a hybrid control analysis on a dataset using BDB

Rendered fromdataset.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-06-21
Started: 2022-09-06

Specifying prior distributions

Rendered fromprior_distributions.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-03-20
Started: 2022-09-06

Conduct a simulation study

Rendered fromsimulation_study.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-04-11
Started: 2022-09-06

Incorporating propensity scores analysis in psborrow2

Rendered frompropensity_scores.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-03-20
Started: 2022-09-22

Comparison of Fixed Weights

Rendered fromweighting.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-03-20
Started: 2022-10-25

Data Simulation

Rendered fromdata_simulation.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-03-18
Started: 2023-10-03

Simple Overview

Rendered fromsimple_overview.Rmdusingknitr::rmarkdownon Oct 25 2024.

Last update: 2024-09-09
Started: 2024-09-09

Readme and manuals

Help Manual

Help pageTopics
Add Covariates for Model Adjustmentadd_covariates
'Analysis' Class.analysis_obj Analysis-class
Coerce a 'psborrow2' object to a data frameas.data.frame.BaselineDataList as_data_frame
Specify Correlated Baseline Covariatesbaseline_covariates
Baseline Data Frame Object.baseline_dataframe BaselineDataFrame-class
Baseline Data Frame List.baseline_data_list BaselineDataList-class
'BaselineObject' class for data simulation.baseline_object BaselineObject-class
Legacy function for the bernoulli priorbernoulli_prior
Legacy function for the beta priorbeta_prior
Create binary covariatebin_var
Binary Cut-Off Transformationbinary_cutoff
'BinaryOutcome' classBinaryOutcome-class
Legacy function for specifying borrowing detailsborrowing_details
Full borrowingborrowing_full
Hierarchical commensurate borrowingborrowing_hierarchical_commensurate
No borrowingborrowing_none
'Borrowing' ClassBorrowing-class
'BorrowingFull' class.borrowing_full BorrowingFull-class
'BorrowingHierarchicalCommensurate' class.borrowing_hierarchical_commensurate BorrowingHierarchicalCommensurate-class
'BorrowingNone' class.borrowing_none BorrowingNone-class
Build the model string by interpolating the Stan templatebuild_model_string
Combine objects in 'psborrow2'c c,SimDataList-method
Legacy function for the cauchy priorcauchy_prior
Check Stancheck_cmdstan check_cmdstanr
Check Data Matrix for Required Columnscheck_data_matrix_has_columns
Create a Fixed External Data Objectcheck_fixed_external_data
Create continuous covariatecont_var
'ContinuousOutcome' classContinuousOutcome-class
Create Covariance Matrixcovariance_matrix
'Covariate' Class.covariate_class Covariates-class
Create alpha stringcreate_alpha_string create_alpha_string,Borrowing-method create_alpha_string,BorrowingHierarchicalCommensurate-method
Compile MCMC sampler using STAN and create analysis objectcreate_analysis_obj
Create Baseline Data Simulation Objectcreate_baseline_object
Create Data Matrixcreate_data_matrix
Data Simulationcreate_data_simulation
Specify a Time to Event Distributioncreate_event_dist null_event_dist
Compile MCMC sampler using STAN and create simulation objectcreate_simulation_obj
Create tau stringcreate_tau_string create_tau_string,Borrowing-method create_tau_string,BorrowingHierarchicalCommensurate-method
Create a 'DataSimEnrollment' Objectcustom_enrollment
Cut Off Functionscut_off_after_events cut_off_after_first cut_off_after_last cut_off_funs cut_off_none
Cut Off Object.datasim_cut_off DataSimCutOff-class
Enrollment Object.datasim_enrollment DataSimEnrollment-class
Event Time Distribution Object.datasim_event DataSimEvent-class
Fixed External Control Data Object.datasim_fixed_external_data DataSimFixedExternalData-class
Data Simulation Object Class.datasim_object DataSimObject-class
Constant Enrollment Ratesenrollment_constant
Evaluate constraintseval_constraints eval_constraints,Prior-method
Example data matrixexample_matrix
Simulated Survival Dataexample_surv
Legacy function for the exponential survival distributionexp_surv_dist
Legacy function for the exponential priorexponential_prior
Legacy function for the gamma priorgamma_prior
Generate Data from Objectgenerate
Generate Data for a 'BaselineObject'generate,BaselineObject-method
Generate Data for a 'DataSimObject'generate,DataSimObject-method
Get 'CmdStanModel' objects for 'MCMCSimulationResults'get_cmd_stan_models get_cmd_stan_models,MCMCSimulationResult-method
Get Simulated Data from 'SimDataList' objectget_data get_data,SimDataList-method
Get prior string for all covariatesget_prior_string_covariates
Get Quantiles of Random Dataget_quantiles
Get results for 'MCMCSimulationResults' objectsget_results get_results,MCMCSimulationResult-method
Get method for Stan modelget_stan_code get_stan_code,Analysis-method
Get Variablesget_vars get_vars,Analysis-method get_vars,BaselineObject-method get_vars,BinaryOutcome-method get_vars,Borrowing-method get_vars,ContinuousOutcome-method get_vars,Covariates-method get_vars,NULL-method get_vars,SimBorrowingList-method get_vars,SimCovariateList-method get_vars,SimOutcomeList-method get_vars,SimTreatmentList-method get_vars,Simulation-method get_vars,TimeToEvent-method get_vars,Treatment-method
Legacy function for the half-cauchy priorhalf_cauchy_prior
Legacy function for the normal half priorhalf_normal_prior
Load and interpolate Stan modelload_and_interpolate_stan_model
Load a Stan 'psborrow2' templateload_stan_file
Legacy function for binary logistic regressionlogistic_bin_outcome
Sample from Stan modelmcmc_sample mcmc_sample,Analysis-method mcmc_sample,ANY-method mcmc_sample,Simulation-method
'MCMCSimulationResult' Class.mcmc_simulation_result MCMCSimulationResult-class
Legacy function for the normal priornormal_prior
Bernoulli distribution with logit parametrizationoutcome_bin_logistic
Normal Outcome Distributionoutcome_cont_normal
Exponential survival distributionoutcome_surv_exponential
Piecewise exponential survival distributionoutcome_surv_pem
Weibull survival distribution (proportional hazards formulation)outcome_surv_weibull_ph
'Outcome' classOutcome-class
'OutcomeBinaryLogistic' class.outcome_bin_logistic OutcomeBinaryLogistic-class
'OutcomeContinuousNormal' class.outcome_cont_normal OutcomeContinuousNormal-class
'OutcomeSurvExponential' Class.outcome_surv_exponential OutcomeSurvExponential-class
'OutcomeSurvPEM' Class.outcome_surv_pem OutcomeSurvPEM-class
'OutcomeSurvWeibullPH' Class.outcome_surv_weibull_ph OutcomeSurvWeibullPH-class
Plot Prior Objectsplot plot,Prior,missing-method plot,PriorBernoulli,missing-method plot,PriorBeta,missing-method plot,PriorCauchy,missing-method plot,PriorExponential,missing-method plot,PriorGamma,missing-method plot,PriorHalfCauchy,missing-method plot,PriorHalfNormal,missing-method plot,PriorNormal,missing-method plot,PriorPoisson,missing-method plot,UniformPrior,missing-method
Plot Probability Density Function Valuesplot_pdf
Plot Probability Mass Function Valuesplot_pmf
Legacy function for the poisson priorpoisson_prior
Get All Variable Names in Simulated Data Model Matrixpossible_data_sim_vars
Prior bernoulli distributionprior_bernoulli
Prior beta distributionprior_beta
Prior cauchy distributionprior_cauchy
Prior exponential distributionprior_exponential
Prior gamma distributionprior_gamma
Prior half-cauchy distributionprior_half_cauchy
Prior half-normal distributionprior_half_normal
Prior normal distributionprior_normal
Prior poisson distributionprior_poisson
'Prior' ClassPrior-class
'PriorBernoulli' Class.prior_bernoulli PriorBernoulli-class
'PriorBeta' Class.prior_beta PriorBeta-class
'PriorCauchy' Class.prior_cauchy PriorCauchy-class
'PriorExponential' Class.prior_exponential PriorExponential-class
'PriorGamma' Class.prior_gamma PriorGamma-class
'PriorHalfCauchy' Class.prior_half_cauchy PriorHalfCauchy-class
'PriorHalfNormal' Class.prior_half_normal PriorHalfNormal-class
'PriorNormal' Class.prior_normal PriorNormal-class
'PriorPoisson' Class.prior_poisson PriorPoisson-class
Rename Covariates in 'draws' Objectrename_draws_covariates
Set Clinical Cut Off Ruleset_cut_off
Set Drop Out Distributionset_dropout
Set Enrollment Rates for Internal and External Trialsset_enrollment
Set transformations in 'BaselineObject' objectsset_transformations
Set Transformations in Baseline Objectsset_transformations,BaselineObject-method
Show guide for objects with guidesshow_guide show_guide,Simulation-method
Input borrowing details for a simulation studysim_borrowing_list
Input covariate adjustment details for a simulation studysim_covariate_list
Specify covariates for simulation studysim_covariates
Summarize the number of continuous and binary covariates in a 'SimCovariates' object created by 'sim_covariates()'sim_covariates_summ
Input generated data for a simulation studysim_data_list
Input outcome details for a simulation studysim_outcome_list
Set simulation study parameters for sample sizesim_samplesize
Input treatment details for a simulation studysim_treatment_list
'SimBorrowingList' Class.sim_borrowing_list SimBorrowingList-class
'SimCovariateList' Class.sim_covariate_list SimCovariateList-class
'SimCovariates' Class.sim_covariates SimCovariates-class
'SimDataList' Class.sim_data_list SimDataList-class
'SimOutcomeList' Class.sim_outcome_list SimOutcomeList-class
'SimSampleSize' Class.sim_samplesize SimSampleSize-class
'SimTreatmentList' Class.sim_treatment_list SimTreatmentList-class
'Simulation' Class.simulation_obj Simulation-class
'SimVar' ClassSimVar-class
'SimVarBin' class.bin_var SimVarBin-class
'SimVarCont' class.cont_var SimVarCont-class
'TimeToEvent' classTimeToEvent-class
Specify Treatment Detailstreatment_details
'Treatment' Class.treatment_class Treatment-class
Trim columns from Data Matrix Based on Borrowing object typetrim_cols trim_cols,Borrowing-method trim_cols,BorrowingHierarchicalCommensurate-method
Trim Rows from Data Matrix Based on Borrowing object typetrim_rows trim_rows,Borrowing-method trim_rows,BorrowingNone-method
Prior uniform distributionuniform_prior
'UniformPrior' Class.uniform_prior UniformPrior-class
Create Variable Dictionaryvariable_dictionary
Legacy function for the Weibull proportional Hazards survival distributionweib_ph_surv_dist