Specify prior distributions and predictors for MCMC methods
set_prior.Rd
Specify prior distributions and predictors for MCMC methods
Arguments
- pred
Predictors to include in the weibull distribution. No covariates except for treatment indicator is included if
pred = NULL
. Only propensity score generated using a logistic regression model on all covariates and treatment indicator are included ifpred = ps
. All covariates and treatment indicator are included ifpred = all
- prior
Prior distribution for the precision parameter that controls the degree of borrowing. Half-cauchy distribution if
prior = "cauchy"
. No external data is included in the data ifprior = "no_ext"
. External control arm is assumed to have the same baseline hazards as internal control arm ifprior = "full_ext"
. Other options include "gamma" and "unif"- r0
Initial values for the shape of the weibull distribution for time-to-events
- alpha
Initial values for log of baseline hazard rate for external and internal control arms. Length of
alpha
should be 1 ifprior = "full_ext"
orprior = "no_ext"
, and equal to 2 otherwise- sigma
Initial values for precision parameter if
prior = "cauchy"
. If leftNULL
, default value 0.03 is used
Examples
# hierachical Bayesian model with precision parameter follows a half-cauchy distribution
set_prior(pred = "none", prior = "cauchy", r0 = 1, alpha = c(0, 0), sigma = 0.03)
#> An object of class ".priorClass"
#> Slot "pred":
#> [1] "none"
#>
#> Slot "prior":
#> [1] "cauchy"
#>
#> Slot "r0":
#> [1] 1
#>
#> Slot "alpha":
#> [1] 0 0
#>
#> Slot "sigma":
#> [1] 0.03
#>
# hierachical Bayesian model with precision parameter follows a gamma distribution
set_prior(pred = "none", prior = "gamma", r0 = 1, alpha = c(0, 0))
#> An object of class ".priorClass"
#> Slot "pred":
#> [1] "none"
#>
#> Slot "prior":
#> [1] "gamma"
#>
#> Slot "r0":
#> [1] 1
#>
#> Slot "alpha":
#> [1] 0 0
#>
#> Slot "sigma":
#> NULL
#>
# conventional Bayesian model to not borrow from external control arm
set_prior(pred = "none", prior = "no_ext", alpha = 0)
#> No initial values for the shape of the weibull distribution (r0) is detected. Default value 1 is used
#> An object of class ".priorClass"
#> Slot "pred":
#> [1] "none"
#>
#> Slot "prior":
#> [1] "no_ext"
#>
#> Slot "r0":
#> [1] 1
#>
#> Slot "alpha":
#> [1] 0
#>
#> Slot "sigma":
#> NULL
#>
# conventional Bayesian model to fully borrow from external control arm
set_prior(pred = "none", prior = "full_ext", alpha = 0)
#> No initial values for the shape of the weibull distribution (r0) is detected. Default value 1 is used
#> An object of class ".priorClass"
#> Slot "pred":
#> [1] "none"
#>
#> Slot "prior":
#> [1] "full_ext"
#>
#> Slot "r0":
#> [1] 1
#>
#> Slot "alpha":
#> [1] 0
#>
#> Slot "sigma":
#> NULL
#>