ss.plot: Function to Plot Sample Size Results

Description Usage Arguments Value Examples

View source: R/plotting_function.R

Description

Plot the sample size results by MAF, OR, Alpha or Power

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
ss.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.OR = NULL,
  select.ES = NULL,
  select.Power = 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 ss.calc

x

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

panel.by

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

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

Only produce graphs for the specified odds ratio(s).

select.ES

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

select.Power

Only produce graphs for the specified power(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 sample size on the Y axis.

Examples

1
2
3
4
ss <- ss.calc(power=0.8, Case.Rate=c(0.5), k=NULL,
    MAF=seq(0.01, 0.05, 0.01), OR=c(4),Alpha=c(0.05),
    True.Model='All', Test.Model='All')
ss.plot(data=ss, x='MAF',panel.by='OR')

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