plotManhattanStyle: Manhattan style plot

Description Usage Arguments Details Author(s) Examples

Description

Generates a plot similar to the GWAS Manhattan plots, which are useful to show significance across multiple significance testings.

Usage

1
plotManhattanStyle(data, y, x, groups = NULL, y.axis.label = "Exposures")

Arguments

data

Dataset from a regression with the p-values.

y

The column in the dataset that contains the independent variables and/or the interaction variables. Must be as a character/string.

x

The column that contains the p-value data. The argument must be a character/string.

groups

The column that splits the tests up, usually is the dependent variable if the data has been looped through a regression test (eg. see loopOutputToListGEE).

y.axis.label

The label for the y-axis.

Details

See the example for a better idea of how to use the function. This style of plot is really useful to use when you have run many eg. interaction testing in a regression analysis and you want to see which variables are barely significant vs very significant, etc. Thus, multiple comparison problems can be dealt with as the plot shows how significant a variable is compared to the rest of the significance tests. This is generally the same reason why GWAS studies use Manhattan plots.

Author(s)

Luke W. Johnston

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
data(state)

## Very simple test example.  Merely to show how the function is used.
outcomes <- c('Income', 'Population')
exposures <- c('Frost', 'Illiteracy')
covariates <- c('Murder', 'LifeExp')
interaction <- 'LifeExp'

## This uses the dplyr package.
ds <- cbind(state.region, state.x77) %>%
  as.data.frame() %>%
  rename(LifeExp = `Life Exp`,
         ## Need to rename the id variable to SID (see description
         ## above)
         SID = state.region) %>%
  arrange(SID)

loopOutputToListGEE(ds, outcomes, exposures, covariates,
                    interactions = interaction,
                    corstr = 'exchangeable') %>%
  extractBetaFromListGEE() %>%
  unlistAndFilterIndep(., ':', pattern = TRUE) %>%
  createCI() %>%
  plotManhattanStyle(., 'indep', 'pvalue', groups = '~ dep')

lwjohnst86/rstatsToolkit documentation built on May 21, 2019, 9:15 a.m.