Coder Social home page Coder Social logo

wenjie2wang / dynsurv Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 416 KB

Dynamic Models for Survival Data

License: GNU General Public License v3.0

C 11.77% C++ 48.24% R 38.79% Makefile 0.44% Shell 0.77%
bayesian cox-model interval-censored survival-analysis time-varying

dynsurv's Introduction

Metrics

dynsurv's People

Contributors

alibool avatar wangxj03 avatar wenjie2wang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dynsurv's Issues

Function to obtain the posterior probability of hypotheses about the hazard ratio or survival differences

Feature request from Alberto Carmona Bayonas:

Hello, good evening Wenjie. I have a question. I see that you have introduced a new function in dynsurv for quick access to the mcmc draws of the coefficients. However, it would be nice to have the same function for survival differences. Currently you can use survDiff but you cannot calculate specific hypotheses. The mcmc's are accessible through the survDiff code, but it is a long, complex piece of code, and impossible to understand except for programmers. Therefore, it is difficult to transmit to a journal reviewer, if requested. Wouldn't you think it would be a good idea to simplify that part by generating a simple way to test hypotheses about survival differences over time?

If you are going to improve the package I think you could create a new function to obtain the posterior probability of hypotheses about the hazard ratio or survival differences. It would be similar to the hypothesis function in the brms package.

library(tidybayes)
mcmc<-mcmc_list$coef
mcmc<- as.tibble(mcmc)

hypothesis <- function (time,value) ecdf(mcmc[mcmc$time==time,]$coef)(log(value))

For example:

hypothesis (time=7,value=0.85) # this would be the probability after 7 months, the hazard ratio is less than 0.85.

This could also be done for the difference in survival. In addition, a plot could be added to represent this posterior probability at various time points, and as a function of various values or priors...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.