apa: apa

Description Usage Arguments Value Examples

View source: R/APA.R

Description

Turn statistical test output into APA style citations. This takes a number of test types and outputs an APA style output for the test. IE Statistic Name_(Degrees of Freedom)=.xx CI[.xx, .xx], p<.xx
If latex is selected, the inline statement must be wrapped in $ or $$ to generate latex properly.

Usage

1
apa(tout, type = "html")

Arguments

tout

The output list from a statistical test. See Details for supported test types.

type

(character) The type of APA style output required, html or latex, defaults to html.

Value

Either an html widget or latex with the APA style output. This function is useful when writing up results from statistical analyses to provide inline APA style declaration of the results given the resulting output of the function. See knitr documentation for info on inline r code. Currently compatible test types are:

kruskal.test

Kruskal-Wallis rank sum test

wilcox.text

Wilcoxon Rank-sum (Mann-Whitney) test

t.test

Difference in means test

anova | aov

Analysis of Variance. Note: Multiple variables will be return as a named list. The APA output for the specific variable can be returned by calling the index by the name of the variable

effsize::cohen.d

Cohen's D and Hedge's G effect sizes

shapiro.test

Shapiro-Wilk test of normality

car::leveneTest

Levene's test for homogeneity of variance across groups

bartlett.test

Bartlett Test of Homogeneity of Variances

fligner.test

Fligner-Killeen Test of Homogeneity of Variances

cor(method="pearson")

Pearson's (r) product-moment test of correlation

Examples

1
2
3
dat <- data.frame(y = rnorm(15,0,1),x = {rnorm(15,0,1) + rnorm(15,0,.02)})
apa(t.test(y = dat$y, x = dat$x))
apa(t.test(y = dat$y, x = dat$x), type = "latex")

yogat3ch/HDA documentation built on Sept. 13, 2019, 8:54 p.m.