Package: psborrow2 0.0.3.4
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:
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')) |
Bug tracker:https://github.com/genentech/psborrow2/issues
- example_matrix - Example data matrix
- example_surv - Simulated Survival Data
bayesian-dynamic-borrowingpsborrow2simulation-study
Last updated 12 days agofrom:bd4dec0da5. Checks:OK: 7. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Oct 25 2024 |
R-4.5-win | OK | Oct 25 2024 |
R-4.5-linux | OK | Oct 25 2024 |
R-4.4-win | OK | Oct 25 2024 |
R-4.4-mac | OK | Oct 25 2024 |
R-4.3-win | OK | Oct 25 2024 |
R-4.3-mac | OK | Oct 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.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-06-21
Started: 2022-09-06
Conduct a hybrid control analysis on a dataset using BDB
Rendered fromdataset.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-06-21
Started: 2022-09-06
Specifying prior distributions
Rendered fromprior_distributions.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-03-20
Started: 2022-09-06
Conduct a simulation study
Rendered fromsimulation_study.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-04-11
Started: 2022-09-06
Incorporating propensity scores analysis in psborrow2
Rendered frompropensity_scores.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-03-20
Started: 2022-09-22
Comparison of Fixed Weights
Rendered fromweighting.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-03-20
Started: 2022-10-25
Data Simulation
Rendered fromdata_simulation.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-03-18
Started: 2023-10-03
Simple Overview
Rendered fromsimple_overview.Rmd
usingknitr::rmarkdown
on Oct 25 2024.Last update: 2024-09-09
Started: 2024-09-09
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Add Covariates for Model Adjustment | add_covariates |
'Analysis' Class | .analysis_obj Analysis-class |
Coerce a 'psborrow2' object to a data frame | as.data.frame.BaselineDataList as_data_frame |
Specify Correlated Baseline Covariates | baseline_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 prior | bernoulli_prior |
Legacy function for the beta prior | beta_prior |
Create binary covariate | bin_var |
Binary Cut-Off Transformation | binary_cutoff |
'BinaryOutcome' class | BinaryOutcome-class |
Legacy function for specifying borrowing details | borrowing_details |
Full borrowing | borrowing_full |
Hierarchical commensurate borrowing | borrowing_hierarchical_commensurate |
No borrowing | borrowing_none |
'Borrowing' Class | Borrowing-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 template | build_model_string |
Combine objects in 'psborrow2' | c c,SimDataList-method |
Legacy function for the cauchy prior | cauchy_prior |
Check Stan | check_cmdstan check_cmdstanr |
Check Data Matrix for Required Columns | check_data_matrix_has_columns |
Create a Fixed External Data Object | check_fixed_external_data |
Create continuous covariate | cont_var |
'ContinuousOutcome' class | ContinuousOutcome-class |
Create Covariance Matrix | covariance_matrix |
'Covariate' Class | .covariate_class Covariates-class |
Create alpha string | create_alpha_string create_alpha_string,Borrowing-method create_alpha_string,BorrowingHierarchicalCommensurate-method |
Compile MCMC sampler using STAN and create analysis object | create_analysis_obj |
Create Baseline Data Simulation Object | create_baseline_object |
Create Data Matrix | create_data_matrix |
Data Simulation | create_data_simulation |
Specify a Time to Event Distribution | create_event_dist null_event_dist |
Compile MCMC sampler using STAN and create simulation object | create_simulation_obj |
Create tau string | create_tau_string create_tau_string,Borrowing-method create_tau_string,BorrowingHierarchicalCommensurate-method |
Create a 'DataSimEnrollment' Object | custom_enrollment |
Cut Off Functions | cut_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 Rates | enrollment_constant |
Evaluate constraints | eval_constraints eval_constraints,Prior-method |
Example data matrix | example_matrix |
Simulated Survival Data | example_surv |
Legacy function for the exponential survival distribution | exp_surv_dist |
Legacy function for the exponential prior | exponential_prior |
Legacy function for the gamma prior | gamma_prior |
Generate Data from Object | generate |
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' object | get_data get_data,SimDataList-method |
Get prior string for all covariates | get_prior_string_covariates |
Get Quantiles of Random Data | get_quantiles |
Get results for 'MCMCSimulationResults' objects | get_results get_results,MCMCSimulationResult-method |
Get method for Stan model | get_stan_code get_stan_code,Analysis-method |
Get Variables | get_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 prior | half_cauchy_prior |
Legacy function for the normal half prior | half_normal_prior |
Load and interpolate Stan model | load_and_interpolate_stan_model |
Load a Stan 'psborrow2' template | load_stan_file |
Legacy function for binary logistic regression | logistic_bin_outcome |
Sample from Stan model | mcmc_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 prior | normal_prior |
Bernoulli distribution with logit parametrization | outcome_bin_logistic |
Normal Outcome Distribution | outcome_cont_normal |
Exponential survival distribution | outcome_surv_exponential |
Piecewise exponential survival distribution | outcome_surv_pem |
Weibull survival distribution (proportional hazards formulation) | outcome_surv_weibull_ph |
'Outcome' class | Outcome-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 Objects | plot 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 Values | plot_pdf |
Plot Probability Mass Function Values | plot_pmf |
Legacy function for the poisson prior | poisson_prior |
Get All Variable Names in Simulated Data Model Matrix | possible_data_sim_vars |
Prior bernoulli distribution | prior_bernoulli |
Prior beta distribution | prior_beta |
Prior cauchy distribution | prior_cauchy |
Prior exponential distribution | prior_exponential |
Prior gamma distribution | prior_gamma |
Prior half-cauchy distribution | prior_half_cauchy |
Prior half-normal distribution | prior_half_normal |
Prior normal distribution | prior_normal |
Prior poisson distribution | prior_poisson |
'Prior' Class | Prior-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' Object | rename_draws_covariates |
Set Clinical Cut Off Rule | set_cut_off |
Set Drop Out Distribution | set_dropout |
Set Enrollment Rates for Internal and External Trials | set_enrollment |
Set transformations in 'BaselineObject' objects | set_transformations |
Set Transformations in Baseline Objects | set_transformations,BaselineObject-method |
Show guide for objects with guides | show_guide show_guide,Simulation-method |
Input borrowing details for a simulation study | sim_borrowing_list |
Input covariate adjustment details for a simulation study | sim_covariate_list |
Specify covariates for simulation study | sim_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 study | sim_data_list |
Input outcome details for a simulation study | sim_outcome_list |
Set simulation study parameters for sample size | sim_samplesize |
Input treatment details for a simulation study | sim_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' Class | SimVar-class |
'SimVarBin' class | .bin_var SimVarBin-class |
'SimVarCont' class | .cont_var SimVarCont-class |
'TimeToEvent' class | TimeToEvent-class |
Specify Treatment Details | treatment_details |
'Treatment' Class | .treatment_class Treatment-class |
Trim columns from Data Matrix Based on Borrowing object type | trim_cols trim_cols,Borrowing-method trim_cols,BorrowingHierarchicalCommensurate-method |
Trim Rows from Data Matrix Based on Borrowing object type | trim_rows trim_rows,Borrowing-method trim_rows,BorrowingNone-method |
Prior uniform distribution | uniform_prior |
'UniformPrior' Class | .uniform_prior UniformPrior-class |
Create Variable Dictionary | variable_dictionary |
Legacy function for the Weibull proportional Hazards survival distribution | weib_ph_surv_dist |