dfpoly.Rd
Fractional polynomial dose-response function
dfpoly(degree = 1, beta.1 = "rel", beta.2 = "rel", power.1 = 0, power.2 = 0)
The degree of the fractional polynomial as defined in Royston and Altman (1994)
Pooling for the 1st fractional polynomial coefficient. Can take "rel"
, "common"
, "random"
or be
assigned a numeric value (see details).
Pooling for the 2nd fractional polynomial coefficient. Can take "rel"
, "common"
, "random"
or be
assigned a numeric value (see details).
Value for the 1st fractional polynomial power (\(\gamma_1\)). Must take any numeric value in the set -2, -1, -0.5, 0, 0.5, 1, 2, 3
.
Value for the 2nd fractional polynomial power (\(\gamma_2\)). Must take any numeric value in the set -2, -1, -0.5, 0, 0.5, 1, 2, 3
.
An object of class("dosefun")
\(\beta_1\) represents the 1st coefficient.
\(\beta_2\) represents the 2nd coefficient.
\(\gamma_1\) represents the 1st fractional polynomial power
\(\gamma_2\) represents the 2nd fractional polynomial power
For a polynomial of degree=1
:
$${\beta_1}x^{\gamma_1}$$
For a polynomial of degree=2
:
$${\beta_1}x^{\gamma_1}+{\beta_2}x^{\gamma_2}$$
\(x^{\gamma}\) is a regular power except where \(\gamma=0\), where \(x^{(0)}=ln(x)\). If a fractional polynomial power \(\gamma\) repeats within the function it is multiplied by another \(ln(x)\).
Argument | Model specification |
"rel" | Implies that relative effects should be pooled for this dose-response parameter separately for each agent in the network. |
"common" | Implies that all agents share the same common effect for this dose-response parameter. |
"random" | Implies that all agents share a similar (exchangeable) effect for this dose-response parameter. This approach allows for modelling of variability between agents. |
numeric() | Assigned a numeric value, indicating that this dose-response 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 dose-response parameters (e.g. Hill parameters in Emax functions) to a single value. |
When relative effects are modelled on more than one dose-response 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 mbnma.run()
.
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.
# 1st order fractional polynomial a value of 0.5 for the power
dfpoly(beta.1="rel", power.1=0.5)
#> $name
#> [1] "fpoly"
#>
#> $fun
#> ~beta.1 * ifelse(dose > 0, ifelse(power.1 == 0, log(dose), dose^power.1),
#> 0)
#> <environment: 0x55e269222120>
#>
#> $params
#> [1] "beta.1" "power.1"
#>
#> $nparam
#> [1] 2
#>
#> $jags
#> [1] "s.beta.1[agent[i,k]] * ifelse(dose[i,k]>0, ifelse(s.beta.2[agent[i,k]]==0, log(dose[i,k]), dose[i,k]^s.beta.2[agent[i,k]]), 0)"
#>
#> $apool
#> beta.1 power.1
#> "rel" "0.5"
#>
#> $bname
#> beta.1 power.1
#> "beta.1" "beta.2"
#>
#> attr(,"class")
#> [1] "dosefun"
# 2nd order fractional polynomial with relative effects for coefficients
# and a value of -0.5 and 2 for the 1st and 2nd powers respectively
dfpoly(degree=2, beta.1="rel", beta.2="rel",
power.1=-0.5, power.2=2)
#> $name
#> [1] "fpoly"
#>
#> $fun
#> ~beta.1 * ifelse(dose > 0, ifelse(beta.3 == 0, log(dose), dose^beta.3),
#> 0) + (beta.2 * ifelse(beta.4 == beta.3, ifelse(dose > 0,
#> ifelse(beta.4 == 0, log(dose)^2, (dose^beta.4) * log(dose)),
#> 0), ifelse(dose > 0, ifelse(beta.4 == 0, log(dose), dose^beta.4),
#> 0)))
#> <environment: 0x55e269129820>
#>
#> $params
#> [1] "beta.1" "beta.2" "power.1" "power.2"
#>
#> $nparam
#> [1] 4
#>
#> $jags
#> [1] "s.beta.1[agent[i,k]] * ifelse(dose[i,k]>0, ifelse(s.beta.3[agent[i,k]]==0, log(dose[i,k]), dose[i,k]^s.beta.3[agent[i,k]]), 0) + (s.beta.2[agent[i,k]] * ifelse(s.beta.4[agent[i,k]]==s.beta.3[agent[i,k]], ifelse(dose[i,k]>0, ifelse(s.beta.4[agent[i,k]]==0, log(dose[i,k])^2, (dose[i,k]^s.beta.4[agent[i,k]]) * log(dose[i,k])), 0), ifelse(dose[i,k]>0, ifelse(s.beta.4[agent[i,k]]==0, log(dose[i,k]), dose[i,k]^s.beta.4[agent[i,k]]), 0)))"
#>
#> $apool
#> beta.1 beta.2 power.1 power.2
#> "rel" "rel" "-0.5" "2"
#>
#> $bname
#> beta.1 beta.2 power.1 power.2
#> "beta.1" "beta.2" "beta.3" "beta.4"
#>
#> attr(,"class")
#> [1] "dosefun"