apa.aov.table | R Documentation |
Creates a fixed-effects ANOVA table in APA style
apa.aov.table(
lm_output,
filename,
table.number = 0,
conf.level = 0.9,
type = 3
)
lm_output |
Regression (i.e., lm) result objects. Typically, one for each block in the regression. |
filename |
(optional) Output filename document filename (must end in .rtf or .doc only) |
table.number |
Integer to use in table number output line |
conf.level |
Level of confidence for interval around partial eta-squared (.90 or .95). A value of .90 is the default, this helps to create consistency between the CI overlapping with zero and conclusions based on the p-value. |
type |
Sum of Squares Type. Type II or Type III; specify, 2 or 3, respectively. Default value is 3. |
APA table object
Smithson, M. (2001). Correct confidence intervals for various regression effect sizes and parameters: The importance of noncentral distributions in computing intervals. Educational and Psychological Measurement, 61(4), 605-632.
Fidler, F., & Thompson, B. (2001). Computing correct confidence intervals for ANOVA fixed-and random-effects effect sizes. Educational and Psychological Measurement, 61(4), 575-604.
#Example 1: 1-way from Field et al. (2012) Discovery Statistics Using R
options(contrasts = c("contr.helmert", "contr.poly"))
lm_output <- lm(libido ~ dose, data = viagra)
table1 <- apa.aov.table(lm_output, table.number = 4)
# Example 2: 2-way from Fidler & Thompson (2001)
# You must set these contrasts to ensure values match SPSS
options(contrasts = c("contr.helmert", "contr.poly"))
lm_output <- lm(dv ~ a*b, data = fidler_thompson)
table2 <- apa.aov.table(lm_output, table.number = 5)
#Example 3: 2-way from Field et al. (2012) Discovery Statistics Using R
# You must set these contrasts to ensure values match SPSS
options(contrasts = c("contr.helmert", "contr.poly"))
lm_output <- lm(attractiveness ~ gender*alcohol, data = goggles)
table3 <- apa.aov.table(lm_output, table.number = 6)
# Save all three table in the same .doc document
apa.save(filename = "my_tables.doc", table1, table2, table3)
# Create a table for your PDF
# Include the lines below in your rmarkdown or Quarto document
apa.knit.table.for.pdf(table1)
apa.knit.table.for.pdf(table2)
apa.knit.table.for.pdf(table3)
# delete demo file
if (file.exists("my_tables.doc")) {
file.remove("my_tables.doc")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.