You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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!
The text was updated successfully, but these errors were encountered: