Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to plot posterior survival with weibull model? #86

Open
tyjchen opened this issue May 15, 2020 · 0 comments
Open

how to plot posterior survival with weibull model? #86

tyjchen opened this issue May 15, 2020 · 0 comments

Comments

@tyjchen
Copy link

tyjchen commented May 15, 2020

is it possible to plot the posterior survival function of a weibull model using survivalstan?
from the example code online, posterior plots are only available when PEM models are used and the data is processed into longitudinal form.

code below to generate weibull model

'
import survivalstan
import stanity
import seaborn as sb
import matplotlib.pyplot as plt
import statsmodels.api as sm
import code

dataset = sm.datasets.get_rdataset(package = 'survival', dataname = 'flchain' )
d = dataset.data.query('futime > 7')
d.reset_index(level = 0, inplace = True)

testfit_wei = survivalstan.fit_stan_survival_model(model_cohort = 'Weibull model',
model_code = survivalstan.models.weibull_survival_model,
df = d,
time_col = 'futime',
event_col = 'death',
formula = 'age + sex',
iter = 200,
chains = 4,
make_inits = survivalstan.make_weibull_survival_model_inits)
`
any guidance would be helpful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant