Type: | Package |
Title: | The Attributable Fraction (AF) Described as a Function of Disease Heritability, Prevalence and Intervention Specific Factors |
Version: | 0.1.0 |
Author: | Elisabeth Dahlqwist |
Maintainer: | Elisabeth Dahlqwist <elisabeth.dahlqwist88@gmail.com> |
Description: | The AFfunction() is a function which returns an estimate of the Attributable Fraction (AF) and a plot of the AF as a function of heritability, disease prevalence, size of target group and intervention effect. Since the AF is a function of several factors, a shiny app is used to better illustrate how the relationship between the AF and heritability depends on several other factors. The app is ran by the function runShinyApp(). For more information see Dahlqwist E et al. (2019) <doi:10.1007/s00439-019-02006-8>. |
License: | GPL-2 | GPL-3 |
Depends: | reshape2, mvtnorm, ggplot2, shiny |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2019-05-17 16:18:29 UTC; elidah |
Repository: | CRAN |
Date/Publication: | 2019-05-17 16:40:03 UTC |
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
The shiny application AFheritability
is a user interface for the function AFfunction
Description
The shiny-app provides a user friendly interface for the function AFfunction
.
Usage
runShinyApp()
Details
By running runShinyApp() a user interface for the function AFfunction
is started in RStudio. The app is also available online https://afheritability.shinyapps.io/afheritability/ (Note that the app is usually faster in the web browser Google Chrome or Firefox).
Author(s)
Elisabeth Dahlqwist
References
Dahlqwist E et al. (2019) <doi:10.1007/s00439-019-02006-8>.