Regarding Stan_surv function

Hi all,

     I wanted to fit some models using Bayesian survival analysis. However, I couldn't find the function "stan_surv" in rstanarm functions. The only option I see is stan_jm, but my model requires survival function with cox regression family or any parametric families. Anyone has any idea when the stan_surv function will be available? 

Thanks.

If you wish to use the stan_surv function you have to install rstanarm from the Stan R package repository. This has not made its way to CRAN yet.

install.packages("rstanarm", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
2 Likes

Hi,

 Thanks for the reply. I have a silly question. If it is not available in CRAN, can I cite the package in my paper if I use this function? 

Thanks.

Hm, not sure on how to cite in that case. I guess citing rstanarm is appropriate but maybe there is something to cite for the survival stuff as well.
Tagging @jonah @sambrilleman who would know more.

@karthy257 Thanks for asking! :-)

Probably make most sense to cite our arXiv paper:

Brilleman, S. L., Elci, E. M., Novik, J. B., & Wolfe, R. (2020). Bayesian Survival Analysis Using the rstanarm R Package. arXiv preprint arXiv:2002.09633, https://arxiv.org/abs/2002.09633.

as well as the usual rstanarm citation:

Goodrich B, Gabry J, Ali I, Brilleman S (2020). “rstanarm: Bayesian applied regression modeling via Stan.” R package version 2.21.1, https://mc-stan.org/rstanarm.

1 Like

Thank you so much. Actually, I have read your paper. I will cite it.

Hi, I have used this link to download the package, but I still cannot get R to recognized the stan_surv function. Is there an additional step required?

Before installing , I removed rstanarm. After installing the link, I restarted rstudio. It worked.

1 Like

It is working now - thank you!

1 Like

Hi,

Same here, I cannot get R to recognized the stan_surv after removing and reinstalling from mc-packages:

# remove.packages(c("StanHeaders", "rstan","rstanarm"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstanarm", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
1 Like

Dear All,
I have the same issue. Using this line:
install.packages(“StanHeaders”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))
doesn’t seem to work. Also tried: devtools::install_github(“stan-dev/rstanarm”, ref = “feature/survival”, build_vignettes = FALSE)

Can anyone help with this?

Thank you very much.

Hi @ermeel ,

Is Stan_surv function available in some form? We definitely want to give it a try but installation steps seem not working

Best,
Esteban

Perhaps the post here will provide some insight into the installation issues you’re having: could not find function "stan_surv" from developer version · Issue #500 · stan-dev/rstanarm · GitHub

For those interested,

I have been able to install it from sources following @sambrilleman thread

R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

other attached packages:
[1] rstanarm_2.21.2 Rcpp_1.0.9

Best,
Esteban