Package 'AFheritability'

Title: The Attributable Fraction (AF) Described as a Function of Disease Heritability, Prevalence and Intervention Specific Factors
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>.
Authors: Elisabeth Dahlqwist
Maintainer: Elisabeth Dahlqwist <[email protected]>
License: GPL-2 | GPL-3
Version: 0.1.0
Built: 2024-10-31 06:40:42 UTC
Source: CRAN

Help Index


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 Prevalence, Heritability, Target or Intervention should be used as the xaxis of the plot. The argument xaxis is a string with values "Prevalence", "Heritability", "Target" or "Intervention".

compare

option to specify which of the arguments Prevalence, Heritability, Target or Intervention should be used for comparisons. The argument compare can be specified as a numeric vector with a range of values or as a single value, see examples.

Intervention_type

an option to specify how the intervention is expected to affect the genetic liability distribution. The default option "location" assumes that the intervention shifts the genetic liability distribution to lower levels, among those targeted by the intervention. The option "scale" assumes that the intervention reduce the variance of the genetic liability distribution, among those targeted by the intervention.

plot

option to return a plot. Default is set to TRUE.

legend

option to return a legend in the plot. Default is set to TRUE.

cex

specifies the text size in the plot. Default is set to size 1.4.

...

further arguments to be passed to the ggplot function. See ggplot.

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>.