Description Usage Arguments Value Author(s) See Also Examples
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.
1 |
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. |
Return a string reporting an inline ANOVA results according to the APA guideline.
Guillaume T. Vallet gtvallet@gmail.com, University of de Montreal (Canada);
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.