apa.descriptives: Generic method to generate an APA style table with...

Description Usage Arguments Details Value Examples

View source: R/apaDescriptives.R

Description

Generic method to generate an APA style table with descriptives for MS Word.

Usage

1
2
3
4
apa.descriptives(data = data.frame(), variables = NULL, report = "",
  title = "APA Table", filename = "APA Table.docx", note = NULL,
  position = "lower", merge = FALSE, sig = TRUE, landscape = FALSE,
  save = TRUE)

Arguments

data

Raw dataset with variables.

variables

The variable names for in the table.

report

(optional) Specify which descriptive statistics to report. Use a subset from c("M", "SD", "r").

title

(optional) Name of the table.

filename

(optional) Specify the filename (including valid '.docx' extension).

note

(optional) Add a footnote to the bottom of the table.

position

(optional) Specify whether the correlations should be displayed in the upper, or lower diagonal of the table.

merge

(optional) Set (TRUE) if the mean and standard deviation columns should be merged into one column.

sig

(optional) Specify whether the significance should be displayed in a separate column.

landscape

(optional) Set (TRUE) if the table should be generated in landscape mode.

save

(optional) Set (FALSE) if the table should not be saved in a document.

Details

This method can automatically generate tables with descriptive statistics. It's possible to specify which descriptives should be displayed. The default setting displays all the means, standard deviations, and a correlation matrix. This can user specified changing the (report) parameter. For large tables it is also possible to merge the mean and stadard deviation in one column “M (SD)”. This can be done by setting the merge parameter to TRUE. It's also possible to make the columns of the correlation matrix smaller, by removing the significance asterisks in the table. The significance of the correlation values are highlighted in a footnote (e.g, Correlation coefficients > |0.23| are significant at p < 0.036."). This can be done by setting the sig parameter to FALSE.

Value

apa.descriptives object; a list consisting of

succes

message in case of an error

save

flag which indicates whther the document is saved

data

dataset with descriptive statistics

table

FlexTable {ReporteRs} object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Use apa.descriptives function
apa.descriptives(
  data = data.frame(
    rnorm(100, mean = 0, sd = 1),
    rnorm(100, mean = 0, sd = 1),
    rnorm(100, mean = 0, sd = 1),
    rnorm(100, mean = 0, sd = 1)
  ),
  variables = c("Column 1", "Column 2", "Column 3", "Column 4")
)

apaStyle documentation built on May 30, 2017, 4:25 a.m.