rMatrix: rMatrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/rMatrix.R

Description

rMatrix provides a correlation matrix with confidence intervals and a p-value adjusted for multiple testing.

Usage

1
2
3
4
5
6
rMatrix(dat, x, y=NULL, conf.level = .95, correction = "fdr",
        digits = 2, pValueDigits=3, colspace=2, rowspace=0,
        colNames ="numbers",
        output="R",
        env.LaTeX = 'tabular',
        pboxWidthMultiplier = 1)

Arguments

dat

A dataframe containing the relevant variables.

x

Vector of 1+ variable names.

y

Vector of 1+ variable names; if this is left empty, a symmetric matrix is created; if this is filled, the matrix will have the x variables defining the rows and the y variables defining the columns.

conf.level

The confidence of the confidence intervals.

correction

Correction for multiple testing: an element out of the vector c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none"). NOTE: the p-values are corrected for multiple testing; The confidence intervals are not (yet :-)).

digits

With what precision do you want the results to print.

pValueDigits

Determines the number of digits to use when displaying p values. P-values that are too small will be shown as p<.001 or p<.00001 etc.

colspace

Number of spaces between columns (only for R output, ignored for LaTeX output)

rowspace

Number of rows between table rows (note: one table row is 2 rows; only for R output, ignored for LaTeX output).

colNames

colNames can be "numbers" or "names". "Names" cause variables names to be printed in the heading; "numbers" causes the rows to become numbered and the numbers to be printed in the heading.

output

Can be "R" or "LaTeX"; if output is set to "LaTeX", the result is a LaTeX table (e.g. for use in knitr).

env.LaTeX

For LaTeX output, the environment can be set with env.LaTeX.

pboxWidthMultiplier

When using LaTeX, pboxWidthMultiplier can be used to make the cells narrower or wider (1 works for anything up until 4 or 5 digits).

Details

rMatrix provides a symmetric or asymmetric matrix of correlations their confidence intervals, and p-values. The p-values can be corrected for multiple testing.

Value

An object with the input and several output variables. Most notably a number of matrices:

r

Pearson r values.

parameter

Degrees of freedom.

ci.lo

Lower bound of Pearson r confidence interval.

ci.hi

Upper bound of Pearson r confidence interval.

p.raw

Original p-values.

p.adj

p-values adjusted for multiple testing.

Author(s)

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters <gjalt-jorn@userfriendlyscience.com>

Examples

1
rMatrix(mtcars, x=c('disp', 'hp', 'drat'))

userfriendlyscience documentation built on May 2, 2019, 1:09 p.m.