getTable: Get correlation tables for data frames.

Description Usage Arguments Details Value See Also

Description

A function to generate correlation tables that can be easily transformed to APA tables.

Usage

1
2
getTable(data, apa = F, xlsx = F, xlsxName = "Result_getTable",
  diag = "", diag2 = "", round = 3, ...)

Arguments

data

The data frame for which the correlations should be computed. Non-numerics are excluded from further processing

apa

logical, apa Should APA style be approximated, leading to a table with an empty upper half. Default is to FALSE.

xlsx

logical, shoudl an xlsx-file be produced? Default is to FALSE.

xlsxName

The name of the resulting xlsx-file, if xlsx = TRUE. Default is to Result getTable.

diag

The value that should be displayed in the first diagonal of the resulting table, e. g. mean. Default is empty.

diag2

The value that should be displayed in the second diagonal of the resulting table, e. g. var. Default is empty.

round

The number of digits that should be displayed. Is passed on to round. Default is 3.

...

Other parameters passed on to pearson.cor.

Details

This is a function that returns a table of correlations and, depending on apa, a table that is losely formatted as an apa table. Pearson correlations (using cor of all variables are computed. Their signifcance levels are also reported, based on the function cor.test from the Hmisc-package.

Value

Returns a data frame with correlations. See Details.

See Also

cor for the functon that computes the correlation, cor.test for the function that computes the p-values, and write.xlsx for the function that writes the Exceltable.


kthorstmann/horst documentation built on May 20, 2019, 7:04 p.m.