AFfunction {AFheritability} | R Documentation |
Plot the attributable fraction as a function of heritability, disease prevalence, size of target group and intervention effect.
Description
AFfunction
is a function which illustrates the AF as a function of heritability, disease prevalence, size of target group and intervention effect.
Usage
AFfunction(Prevalence, Heritability, Target, Intervention, xaxis, compare,
Intervention_type = "location", plot = TRUE, legend = TRUE,
cex = 1.4, ...)
Arguments
Prevalence |
an estimate of the disease prevalence |
Heritability |
an estimate of the disease heritability |
Target |
proportion of those at highest genetic risk being targeted by the intervention |
Intervention |
effect of intervention |
xaxis |
option to specify which of the arguments |
compare |
option to specify which of the arguments |
Intervention_type |
an option to specify how the intervention is expected to affect the genetic liability distribution. The default option |
plot |
option to return a plot. Default is set to |
legend |
option to return a legend in the plot. Default is set to |
cex |
specifies the text size in the plot. Default is set to size |
... |
further arguments to be passed to the ggplot function. See |
Details
The AFfunction() is a function that produce a plot of the AF as a function of Prevalence, Heritability, Target
or Intervention
. A user interface of the function is provided in runShinyApp
.
Value
AF |
the AF as a function of heritability, disease prevalence, size of target group and intervention effect. |
plot |
Plot of the AF as a function of either heritability, disease prevalence, size of target group and intervention effect. The legend shows a comparison variable. |
References
Dahlqwist E et al. (2019) <doi:10.1007/s00439-019-02006-8>.
Examples
# Example
heritability <- seq(0,1, by=0.1)
target_sizes <- sort(c(0.30, 0.25, 0.20, 0.15, 0.05, 0.01))
AF_h <- AFfunction(Prevalence=0.5, Heritability = heritability,
Target = target_sizes, Intervention = 1,
compare="Target", xaxis = "Heritability",
ylim = c(0,0.3), cex = 1.6)
AF_h