-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e42d7e
commit 4d1c116
Showing
32 changed files
with
1,903 additions
and
650 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
1868650e39faca1f5dedc86c07805b25 *DESCRIPTION | ||
54e2e2200e0daa66e9280c35d1b4000b *NAMESPACE | ||
ea197f74ec3c62ca7e62a4e0138bd1de *NEWS.md | ||
2100e91bb0b3d40e8dab72338c31364e *DESCRIPTION | ||
528177306a09bb4b73a2d277e4774f41 *NAMESPACE | ||
589656534e41b8049f499f8588b24cb7 *NEWS.md | ||
7ae1823500df61c6e97cd9c55c9887ee *R/RcppExports.R | ||
17c06d2717a04d99091398ebdaba248e *R/coef.psbcSpeedUp.R | ||
e72d4c8e2051f1c3b28f183877177cfa *R/coef.psbcSpeedUp.R | ||
c0dd2e03b926a0d3c5ee44898121cfbe *R/exampleData.R | ||
8f6d5a01629e0114c94b6a40b5effb50 *R/plot.psbcSpeedUp.R | ||
3eaa3a18e170d678eae4987cd3b853de *R/psbcSpeedUp.R | ||
4942867172878bba53688412bd604ec3 *README.md | ||
6dbf181478c9ac518bb19a51aabfd071 *cleanup | ||
705a0e2e69bd51f57ba3946767b27d3e *R/plot.psbcSpeedUp.R | ||
2d4e430e28f76e8f8ecf4e559f4e27ba *R/plotBrier.R | ||
ad667492d82cfeb09de126ff0ef00df9 *R/predict.psbcSpeedUp.R | ||
0f897c98dfb5e258207f57b477748efc *R/psbcSpeedUp.R | ||
bb43106f8e2b174e93d6b5be3258e87c *README.md | ||
f5f1417afaaf64682000372990355e1c *build/vignette.rds | ||
7b46749938e49991ac03f0fec0dd825b *cleanup | ||
b10b1d4c04f04e9373c3ca9fb70f160f *configure | ||
b7870d69722ee15726af3d1b9a503c8a *configure.ac | ||
f91c2ee39ced0e6e91f98b81e9344f11 *data/datalist | ||
7b548c9bd6a373f888b1abd5f788be24 *data/exampleData.rda | ||
d5bf793431394a60bbbb8c177199a114 *man/coef.psbcSpeedUp.Rd | ||
8f9e9b60cc3d91d8587aac05992e1578 *inst/doc/BayesCox.R | ||
c9b3cf22cbf9c151eff3cd5138214bb3 *inst/doc/BayesCox.Rmd | ||
c1714fc32357cecdc7b9a25dbd310495 *inst/doc/BayesCox.html | ||
c71ddfcaa90c21b64cbff740de7f58e1 *man/coef.psbcSpeedUp.Rd | ||
ceb1aaadfdec68603d5cc77d5f796051 *man/exampleData.Rd | ||
198b70412d51b344f358c6bdf480f5c7 *man/figures/README_plot_beta.png | ||
c060bdd050536703a862d7643828f59a *man/plot.psbcSpeedUp.Rd | ||
ace731c93dee9955cd42e9c1945af37e *man/psbcSpeedUp.Rd | ||
9d60f8c028133fa5c6a3cd284e1e00ed *man/figures/README_plot_brier.png | ||
335479598736f774954c56b098dfc737 *man/plot.psbcSpeedUp.Rd | ||
09fec13c66ae23170a78f21c5cf5b2e9 *man/plotBrier.Rd | ||
26494214e06876cf942b75ecfde81728 *man/predict.psbcSpeedUp.Rd | ||
7dc417e48efb39b297c96a458967937f *man/psbcSpeedUp.Rd | ||
2a825488988b01ee93aea8f884fc9070 *src/Makevars.in | ||
83488be6b1f2f015234720a0a25ff076 *src/Makevars.win | ||
4c38a99ae49306c08d6798a2b4c21dbc *src/RcppExports.cpp | ||
d41d8cd98f00b204e9800998ecf8427e *src/drive-e758d6e6.o.tmp | ||
488b8a39ebc55e50d4decc286f6b7995 *src/drive.cpp | ||
15069450d96221dda3b547bae245aaeb *src/drive.h | ||
ca89b29337087802b658b063fcedf3b1 *src/global.cpp | ||
fcc63ff239f7e16106ebff3b268e81a8 *src/global.h | ||
185e7e0d65856fa49943cb9e87e28875 *src/init.c | ||
6441a235e47e5cf4fde31c3ff81cc10c *src/psbc.cpp | ||
73b9016725850b3dab1e3bdce00e846d *src/psbc.h | ||
a208ba9b0b9b6953dd665b516eba303d *src/drive.cpp | ||
a4d019b89b1606ffd530751c1e640f63 *src/drive.h | ||
99fa8dc58ea0ffc37d1e6e5e2e51d378 *src/global.cpp | ||
05ad67a54a213f89504a68cc7a253f86 *src/global.h | ||
cc174f5cdd978352648cec44c0919628 *src/init.c | ||
b3fe30bb06c10bed689613b6c0d7c82c *src/psbc.cpp | ||
ca15a2e754117b535063fb35585ad1ca *src/psbc.h | ||
63fb7f837f5ead3567c138071d25469d *src/pugiconfig.h | ||
2a482565cd695663ed7426f6302af0ae *src/pugixml.cpp | ||
654ec0ae83f4bc6dcdd26c633cb4ee08 *src/pugixml.h | ||
e07acc941971e653481244878da70084 *src/utils.cpp | ||
89b7b0a35fd94e7bdec8f425188492eb *src/utils.h | ||
ed81f47ae1fcab8a9c33b71a53ed8f81 *src/utils.cpp | ||
ab4382c863ccfbb58cef66a0bb024c33 *src/utils.h | ||
c9b3cf22cbf9c151eff3cd5138214bb3 *vignettes/BayesCox.Rmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#' psbcSpeedUp | ||
#' | ||
#' @title Time-dependent Brier scores | ||
#' | ||
#' @description | ||
#' Predict time-dependent Brier scores based on Cox regression models | ||
#' | ||
#' @name plotBrier | ||
#' | ||
#' @importFrom ggplot2 ggplot aes geom_step theme element_blank | ||
#' | ||
#' @param object fitted object obtained with \code{psbcSpeedUp} | ||
#' @param survObj.new a list containing observed data from new subjects with | ||
#' components \code{t}, \code{di}, \code{x}. If \code{NULL}, the prediction is | ||
#' based on the training data | ||
#' @param times maximum time point to evaluate the prediction | ||
#' @param method option to use the posterior mean (\code{"mean"}) of coefficients | ||
#' for prediction or Bayesian model averaging (\code{"BMA"}) for prediction | ||
#' @param \dots not used | ||
#' | ||
#' @keywords survival | ||
##' @examples | ||
##' | ||
#' # Load the example dataset | ||
#' data("exampleData", package = "psbcSpeedUp") | ||
#' p <- exampleData$p | ||
#' q <- exampleData$q | ||
#' survObj <- exampleData[1:3] | ||
#' | ||
#' # Set hyperparameters | ||
#' mypriorPara <- list( | ||
#' "groupInd" = 1:p, "eta0" = 0.02, "kappa0" = 1, "c0" = 2, "r" = 10 / 9, | ||
#' "delta" = 1e-05, "lambdaSq" = 1, "sigmaSq" = runif(1, 0.1, 10), | ||
#' "beta.prop.var" = 1, "beta.clin.var" = 1) | ||
#' | ||
#' \donttest{ | ||
#' # run Bayesian Lasso Cox | ||
#' library("psbcSpeedUp") | ||
#' set.seed(123) | ||
#' fitBayesCox <- psbcSpeedUp(survObj, | ||
#' p = p, q = q, hyperpar = mypriorPara, | ||
#' nIter = 10, burnin = 0, outFilePath = tempdir() | ||
#' ) | ||
#' # predict survival probabilities of the train data | ||
#' plotBrier(fitBayesCox, times = 80) | ||
#' } | ||
#' | ||
#' @export | ||
plotBrier <- function(object, survObj.new = NULL, | ||
method = "mean", times = NULL, ...) { | ||
|
||
Brier_score <- predict.psbcSpeedUp(object, | ||
survObj.new = survObj.new, | ||
method = method, | ||
times = times) | ||
Brier <- model <- NULL | ||
#Brier_score %>% | ||
ggplot2::ggplot(Brier_score, | ||
aes(times, Brier, group = model, color = model)) + | ||
xlab("Evaluation time points") + | ||
ylab("Brier score") + | ||
geom_step(direction = "vh") + | ||
theme(legend.title = element_blank()) | ||
} |
Oops, something went wrong.