Code for Schnell, Tang, Offen & Carlin, "A Bayesian credible subgroups approach to identifying subgroups with positive treatment effects." Biometrics (2016)
schnellp/Biom-2016-Credsubs
master
Name already in use
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
FILES: - alzheimers.csv: Contains cleaned data for the Alzheimer's disease example. - bayes-linear.R: Defines functions related to the methods described in the paper. - decomp.R Produces estimate, standard error, and observation plots used in example analysis. - example.R: Reproduces the Alzheimer's disease example analysis. - simulate.R: Reproduces the simulation study. TO RUN ALZHEIMER'S DISEASE ANALYSIS: - Packages required: MASS, Matrix, matrixcalc, matrixStats, mvtnorm, plotrix, vcd. - Make sure working directory is set to the directory containing the R scripts. - Run example.R. - To reproduce the decomposition plots, run decomp.R. TO RUN SIMULATION STUDY: - Packages required: MASS, Matrix, matrixcalc, matrixStats, mvtnorm, BayesTree. - Make sure working directory is set to the directory containing the R scripts. - Run simulate.R. This may take several hours. - Simulation results are saved in tables-n.RData, where n is the sample size (default 40). TO ANALYZE A NEW DATASET: - Load bayes-linear.R - Defaults: call blm() with syntax used by lm(). - Custom prior: call blm(..., design=TRUE) to get the design matrix, and specify hyperparameters accordingly. - Create grid approximating the covariate space of interest. - Call the find.credible.subgroups function. - See example.R for an example use.
About
Code for Schnell, Tang, Offen & Carlin, "A Bayesian credible subgroups approach to identifying subgroups with positive treatment effects." Biometrics (2016)