R functions for formatting results in APA style and other stuff
HTML R
Latest commit e3e86b4 Feb 17, 2017 @achetverikov two new parameters and examples for describe.mean.and.t
#' @param aggregate_by do the aggregation by the thrird variable(s):
either NULL (default), a single vector variable, or a list of variables
to aggregate by.
#' @param transform_means a function to transform means and confidence
intervals (default: NULL)

README.md

R functions for formatting results in APA style and other stuff

What is it?

Functions for APA-style formatting for statistical tests results in markdown or LaTeX and other miscellanous stuff.

Main functions

describe.Anova Describe Anova results
describe.aov Describe aov results
describe.bimod.test Describe bimodality test results
describe.binom.mean.conf Describe mean and confidence intervals for binomial variable
describe.chi Describe $chi^2$ results
describe.dip.test Describe Hartigans' dip test results
describe.ezanova Describe ezANOVA results
describe.glm Describe regression model (GLM, GLMer, lm, lm.circular, ...)
describe.lmer Describe lmer results
describe.lmert Describe lmerTest results
describe.lmtaov Describe lmerTest anova results
describe.lsmeans Describe contrasts created by lsmeans
describe.mean.and.t Describe two-sample t-test with means and effect sizes
describe.mean.conf Describe mean and confidence intervals
describe.mean.sd Describe mean and SD
describe.r Describe Pearson test results
describe.roc.diff Describe differences between ROC curves
describe.ttest Describe t-test results

How to install?

install.packages("devtools")
devtools::install_github('ralfer/apa_format_and_misc',subdir='apastats')
library(apastats)

How to use?

Most of the functions have names like "describe.something" where something is a name of statistical test or R function.

They take results of statistical test as input and provide a formatted output. So, for example, if you use repeated measures ANOVA, you can easily get something like "F(3, 54) = 516.61, p < .001" from ezANOVA results.

Methods included:

  • chi-squared
  • Pearson r
  • t-test
  • ANOVA, rm ANOVA
  • lm, glm, lmer

Additional functions:

  • plotting - pointrange plots with optional within-subject CIs; breaks-computing functions for Tufte-like plots
  • misc - drop.empty.cols() to drop empty columns from df, mymean() and mysd() for means and SDs without NA, lengthu() for length(unique(x))

Some examples can be found here: https://github.com/ralfer/apa_format_and_misc/blob/master/example/example.md and in help files.

Disclaimer

Everything is provided as is, contributions are welcome, authors of borrowed functions are mentioned in functions descriptions.