or.plot: Function to Plot Odds Ratio Results

Description Usage Arguments Value Examples

View source: R/plotting_function.R

Description

Plot the power results by MAF, Power, Alpha or N

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
or.plot(
  data = NULL,
  x = "MAF",
  panel.by = "True.Model",
  y_limit = NULL,
  y_log = F,
  return_gg = F,
  linear.effect.measure = "ES",
  select.Alpha = NULL,
  select.power = NULL,
  select.ES = NULL,
  select.N = NULL,
  select.MAF = NULL,
  select.Case.Rate = NULL,
  select.SD = NULL,
  select.True.Model = NULL,
  select.Test.Model = NULL
)

Arguments

data

The data frame result from power.calc

x

The desired variable on the y axis: "MAF", "OR", "Alpha", or "N_total"

panel.by

A grouping variable to panel the graphs by: "True.Model", "MAF", "Power", "Alpha", or "N_total"

y_limit

An object specifying the minimum and maximum of the y-axis (eg c(0,4)) default is NULL, which allows the limits to be picked automatically

y_log

Logical, specifying whether the y axis should be logarithmic. Default is F

return_gg

Logical, specifying whether to return the ggplot object instead of printing out the plot

linear.effect.measure

Should the graphs indicate ES values, or R2 values? (default ES)

select.Alpha

Only produce graphs for the specified Alpha level(s).

select.power

Only produce graphs for the specified Power(s).

select.ES

Only produce graphs for the specified effect sizes(s).

select.N

Only produce graphs for the specified sample size(s).

select.MAF

Only produce graphs for the specified minor allele frequency(ies).

select.Case.Rate

Only produce graphs for the specified case rate(s).

select.SD

Only produce graphs for the specified standard deviation(s).

select.True.Model

Only produce graphs for the specified true genetic model(s): "Additive", "Dominant", "Recessive".

select.Test.Model

Only produce graphs for the specified testing model(s): "Additive", "Dominant", "Recessive", "2df".

Value

A series of plots with power on the Y axis.

Examples

1
2
3
4
or <- odds_ratio_function(N=1000, Case.Rate=0.5, k=NULL,
    MAF=seq(0.3, 0.32, 0.01), power=0.8,Alpha=0.05,
    True.Model=c("Dominant", "Recessive"), Test.Model=c("Dominant", "Recessive"))
or.plot(data=or, x='MAF')

genpwr documentation built on March 31, 2021, 1:06 a.m.