fezAov: Export ezANOVA results to Knitr/Sweave in APA format

Description Usage Arguments Value Author(s) See Also Examples

View source: R/fezAov.R

Description

A function to format a given treatement (i.e. row) of an ezANOVA (package "ez") to a Markdown/LaTeX format according to the APA guidelines. The output can be directly used in a Knitr/Sweave document. The function tests if the Mauchly's test for sphericity is significant, and if so, report the corrected values using the Greenhouse-Geisser correction.

Usage

1
fezAov(anova, ttt, apa = FALSE)

Arguments

anova

An ezANOVA object.

ttt

A digit indicating which row to format, or the name of the treatment in the ANOVA.

apa

A boolean index to format results according to the APA guideline (remove 0 before the decimal point). Default to False.

Value

Return a string reporting an inline ANOVA results according to the APA guideline.

Author(s)

Guillaume T. Vallet gtvallet@gmail.com, University of de Montreal (Canada);

See Also

ftt, fmsd

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Generate fake data with a subject number in the first colum, a
#  fake experimental condition in the second column and fake
#  reaction times in the third column
df = rbind(data.frame(Subj=1:10,  Cond="Control", RT=rnorm(10, mean=720, sd=59)),
           data.frame(Subj=11:20, Cond="Test", RT=rnorm(10, mean=680, sd=45)),
           data.frame(Subj=21:30, Cond="Test2", RT=rnorm(10, mean=650, sd=49)))
# Convert subject and independant variable to factors
df$Subj = as.factor(df$Subj)
df$Cond = as.factor(df$Cond)

# Compute the ANOVA 
anova = ezANOVA(df, wid=.(Subj), between=.(Cond), dv=RT)       

# Format the results
fezAov(anova, ttt=1)

Cogitos/statxp documentation built on March 22, 2021, 6:38 a.m.