| prior_pred | R Documentation | 
Simulate a dataset from the prior predictive distribution of survival times in an M-spline survival model. Additive hazards models not currently supported.
prior_pred(
  n,
  fix_prior = FALSE,
  mspline,
  censtime = Inf,
  coefs_mean = NULL,
  prior_hscale = p_normal(0, 20),
  prior_hsd = p_gamma(2, 1),
  newdata = NULL,
  formula = NULL,
  prior_loghr = NULL,
  prior_hrsd = NULL,
  prior_cure = NULL
)
| n | Sample size of the simulated dataset. Each observation in the dataset is generated from a model with the same parameters. These parameters are generated from a single simulation from the prior distribution. | 
| fix_prior | If  | 
| mspline | A list of control parameters defining the spline model. 
 
 If there are external data, and both  
 
 
 | 
| censtime | Right-censoring time to impose on the simulated event times. | 
| coefs_mean | Spline basis coefficients that define the prior
mean for the hazard function. By default, these are set to values
that define a constant hazard function (see
 | 
| prior_hscale | Prior for the baseline log hazard scale
parameter ( Note that  "Baseline" is defined by the continuous covariates taking a value of zero and factor covariates taking their reference level. To use a different baseline, the data should be transformed appropriately beforehand, so that a value of zero has a different meaning. For continuous covariates, it helps for both computation and interpretation to define the value of zero to denote a typical value in the data, e.g. the mean. | 
| prior_hsd | Gamma prior for the standard deviation that
controls the variability over time (or smoothness) of the hazard
function.  This should be a call to  | 
| newdata | A data frame with one row, containing variables in the model formulae. Samples will then be drawn, for any covariate-dependent parameters, with covariates set to the values given here. | 
| formula | A model formula with no response, defining the covariates on the hazard scale. | 
| prior_loghr | Priors for log hazard ratios.  This should be a
call to  The default is  | 
| prior_hrsd | Prior for the standard deviation parameters that
smooth the non-proportionality effects over time in
non-proportional hazards models.  This should be a call to
 | 
| prior_cure | Prior for the baseline cure probability.  This should be a
call to  | 
A data frame with columns time (simulated time) and
event (indicator for whether the time is an event time, as
opposed to a right-censoring time).  The prior parameters are
returned in the prior attribute as a list with components
alpha (baseline log hazard) and coefs (spline
coefficients).
prior_sample
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.