Fractional polynomial time-course function
tfpoly.Rd
As first described for use in Network Meta-Analysis by Jansen et al. (2015) .
Usage
tfpoly(
degree = 1,
pool.1 = "rel",
method.1 = "common",
pool.2 = "rel",
method.2 = "common",
method.power1 = 0,
method.power2 = 0
)
Arguments
- degree
The degree of the fractional polynomial as defined in Royston and Altman (1994)
- pool.1
Pooling for the 1st fractional polynomial coefficient. Can take
"rel"
or"abs"
(see details).- method.1
Method for synthesis of the 1st fractional polynomial coefficient. Can take
"common
,"random"
, or be assigned a numeric value (see details).- pool.2
Pooling for the 2nd fractional polynomial coefficient. Can take
"rel"
or"abs"
(see details).- method.2
Method for synthesis of the 2nd fractional polynomial coefficient. Can take
"common
,"random"
, or be assigned a numeric value (see details).- method.power1
Value for the 1st fractional polynomial power. Must take any numeric value in the set
-2, -1, -0.5, 0, 0.5, 1, 2, 3
.pool
for this parameter is set to"abs"
.- method.power2
Value for the 2nd fractional polynomial power. Must take any numeric value in the set
-2, -1, -0.5, 0, 0.5, 1, 2, 3
.pool
for this parameter is set to"abs"
.
Details
\(\beta_1\) represents the 1st coefficient.
\(\beta_2\) represents the 2nd coefficient.
\(p_1\) represents the 1st power
\(p_2\) represents the 2nd power
For a polynomial of degree=1
:
$${\beta_1}x^{p_1}$$
For a polynomial of degree=2
:
$${\beta_1}x^{p_1}+{\beta_2}x^{p_2}$$
\(x^{(p)}\) is a regular power except where \(p=0\), where \(x^{(0)}=ln(x)\). If a fractional polynomial power \(p_m\) repeats within the function it is multiplied by another \(ln(x)\).
Time-course parameters
Time-course parameters in the model must be specified using a pool
and a method
prefix.
pool
is used to define the approach used for pooling of a given time-course parameter and
can take any of:
Argument | Model specification |
"rel" | Indicates that relative effects should be pooled for this time-course parameter. Relative effects preserve randomisation within included studies, are likely to vary less between studies (only due to effect modification), and allow for testing of consistency between direct and indirect evidence. Pooling follows the general approach for Network Meta-Analysis proposed by Lu and Ades (2004) . |
"abs" | Indicates that study arms should be pooled across the whole network for this time-course parameter independently of assigned treatment to estimate an absolute effect. This implies estimating a single value across the network for this time-course parameter, and may therefore be making strong assumptions of similarity. |
method
is used to define the model used for meta-analysis for a given time-course parameter
and can take any of the following values:
Argument | Model specification |
"common" | Implies that all studies estimate the same true effect (often called a "fixed effect" meta-analysis) |
"random" | Implies that all studies estimate a separate true effect, but that each of these true effects vary randomly around a true mean effect. This approach allows for modelling of between-study heterogeneity. |
numeric() | Assigned a numeric value, indicating that this time-course parameter should not be estimated from the data but should be assigned the numeric value determined by the user. This can be useful for fixing specific time-course parameters (e.g. Hill parameters in Emax functions, power parameters in fractional polynomials) to a single value. |
When relative effects are modelled on more than one time-course parameter,
correlation between them is automatically estimated using a vague inverse-Wishart prior.
This prior can be made slightly more informative by specifying the scale matrix omega
and by changing the degrees of freedom of the inverse-Wishart prior
using the priors
argument in mb.run()
.
References
Jansen JP, Vieira MC, Cope S (2015).
“Network meta-analysis of longitudinal data using fractional polynomials.”
Stat Med, 34(15), 2294-311.
ISSN 1097-0258 (Electronic) 0277-6715 (Linking), doi:10.1002/sim.6492
, https://pubmed.ncbi.nlm.nih.gov/25877808/.
Lu G, Ades AE (2004).
“Combination of direct and indirect evidence in mixed treatment comparisons.”
Stat Med, 23(20), 3105-24.
ISSN 0277-6715 (Print) 0277-6715 (Linking), doi:10.1002/sim.1875
, https://pubmed.ncbi.nlm.nih.gov/15449338/.
Royston P, Altman D (1994).
“Regression Using Fractional Polynomials of Continuous Covariates: Parsimonious Parametric Modelling.”
Journal of the Royal Statistical Society: Series C, 43(3), 429-467.
Examples
# 1st order fractional polynomial with random effects
tfpoly(pool.1="rel", method.1="random")
#> $name
#> [1] "fpoly"
#>
#> $fun
#> ~beta.1 * ifelse(time > 0, ifelse(beta.2 == 0, log(time), time^beta.2),
#> 0)
#> <environment: 0x556fffd485f8>
#>
#> $f
#> function (time, beta.1, beta.2)
#> {
#> if (time > 0) {
#> if (beta.2 == 0) {
#> y <- log(time)
#> }
#> else {
#> y <- time^beta.2
#> }
#> }
#> else {
#> y <- 0
#> }
#> return(beta.1 * y)
#> }
#> <bytecode: 0x556fffd58438>
#> <environment: 0x556fffd485f8>
#>
#> $latex
#> [1] "TO BE WRITTEN"
#>
#> $params
#> [1] "beta.1" "power1"
#>
#> $nparam
#> [1] 2
#>
#> $jags
#> [1] "beta.1[i,k] * ifelse(time[i,m]>0, ifelse(beta.2==0, log(time[i,m]), time[i,m]^beta.2), 0)"
#>
#> $apool
#> beta.1 power1
#> "rel" "abs"
#>
#> $amethod
#> beta.1 power1
#> "random" "0"
#>
#> $bname
#> beta.1 power1
#> "beta.1" "beta.2"
#>
#> $bpool
#> beta.1 power1
#> "pool.1" "pool.2"
#>
#> $bmethod
#> beta.1 power1
#> "method.1" "method.2"
#>
#> attr(,"class")
#> [1] "timefun"
# 2nd order fractional polynomial
# with a single absolute parameter estimated for the 2nd coefficient
# 1st power equal to zero
tfpoly(degree=2, pool.1="rel", method.1="common",
pool.2="abs", method.2="random",
method.power1=0)
#> $name
#> [1] "fpoly"
#>
#> $fun
#> ~beta.1 * ifelse(time > 0, ifelse(beta.3 == 0, log(time), time^beta.3),
#> 0) + (beta.2 * ifelse(beta.4 == beta.3, ifelse(time > 0,
#> ifelse(beta.4 == 0, log(time)^2, (time^beta.4) * log(time)),
#> 0), ifelse(time > 0, ifelse(beta.4 == 0, log(time), time^beta.4),
#> 0)))
#> <environment: 0x556fffbaf9f8>
#>
#> $f
#> function (time, beta.1, beta.2, beta.3, beta.4)
#> {
#> if (time > 0) {
#> if (beta.3 == 0) {
#> y1 <- log(time)
#> }
#> else {
#> y1 <- time^beta.3
#> }
#> }
#> else {
#> y1 <- 0
#> }
#> y1 <- beta.1 * y1
#> if (beta.4 == beta.3) {
#> if (time > 0) {
#> if (beta.4 == 0) {
#> y2 <- log(time)^2
#> }
#> else {
#> y2 <- time^beta.4 * log(time)
#> }
#> }
#> else {
#> if (time > 0) {
#> if (beta.4 == 0) {
#> y2 <- log(time)
#> }
#> else {
#> y2 <- time^beta.4
#> }
#> }
#> }
#> }
#> else {
#> y2 <- 0
#> }
#> return(y1 + y2)
#> }
#> <bytecode: 0x556fffd59388>
#> <environment: 0x556fffbaf9f8>
#>
#> $latex
#> [1] "TO BE WRITTEN"
#>
#> $params
#> [1] "beta.1" "beta.2" "power1" "power2"
#>
#> $nparam
#> [1] 4
#>
#> $jags
#> [1] "beta.1[i,k] * ifelse(time[i,m]>0, ifelse(beta.3==0, log(time[i,m]), time[i,m]^beta.3), 0) + (i.beta.2[i,k] * ifelse(beta.4==beta.3, ifelse(time[i,m]>0, ifelse(beta.4==0, log(time[i,m])^2, (time[i,m]^beta.4) * log(time[i,m])), 0), ifelse(time[i,m]>0, ifelse(beta.4==0, log(time[i,m]), time[i,m]^beta.4), 0)))"
#>
#> $apool
#> beta.1 beta.2 power1 power2
#> "rel" "abs" "abs" "abs"
#>
#> $amethod
#> beta.1 beta.2 power1 power2
#> "common" "random" "0" "0"
#>
#> $bname
#> beta.1 beta.2 power1 power2
#> "beta.1" "beta.2" "beta.3" "beta.4"
#>
#> $bpool
#> beta.1 beta.2 power1 power2
#> "pool.1" "pool.2" "pool.3" "pool.4"
#>
#> $bmethod
#> beta.1 beta.2 power1 power2
#> "method.1" "method.2" "method.3" "method.4"
#>
#> attr(,"class")
#> [1] "timefun"