Calculate the time-dependent hazard ratios obtained from fitting a fractional polynomial model (first or second order).

get_fp_HR(
  x,
  fit,
  trt.nos,
  ref.no,
  trt.labs = NULL,
  node = "d",
  CI = TRUE,
  revert = FALSE
)

Arguments

x

A vector with the dependent variable.

fit

An rjags object with the output from the JAGS fit.

trt.nos

A vector with the numerical treatment IDs for which the HRs shall be calculated (including the ref).

ref.no

An integer with the numerical ID of the reference for the HR calculations.

trt.labs

A character vector of same length as trt.nos with the treatment labels.

node

A character string that identifies the node in the JAGS model giving the treatment effect estimates.

CI

Logical, shall CIs for the fractional polynomial be given? (Medians are always provided.)

Value

A data frame with pointwise median (and CI) HRs for all comparisons of trt.nos vs ref.no.

Details

Requires the packages: dplyr, coda.