View source: R/apaANOVATable2way.R
apa.2way.table | R Documentation |
Creates a table of means and standard deviations for a 2-way ANOVA design in APA style
apa.2way.table(
iv1,
iv2,
dv,
data,
filename = NA,
table.number = 0,
show.conf.interval = FALSE,
show.marginal.means = FALSE,
landscape = TRUE
)
iv1 |
Name of independent variable 1 column in data frame |
iv2 |
Name of independent variable 2 column in data frame |
dv |
Name of dependent variable column in data frame |
data |
Project data frame name |
filename |
(optional) Output filename document filename (must end in .rtf or .doc only) |
table.number |
Integer to use in table number output line |
show.conf.interval |
(TRUE/FALSE) Display confidence intervals in table. Negates show.marginal.means = TRUE. |
show.marginal.means |
(TRUE/FALSE) Show marginal means in output. Only used if show.conf.interval = FALSE. |
landscape |
(TRUE/FALSE) Make RTF file landscape |
APA table object
# Example 2: 2-way from Fidler & Thompson (2001)
table2 <- apa.2way.table(iv1 = a, iv2 = b, dv = dv,
data = fidler_thompson,
landscape = TRUE,
table.number = 2)
# Example 3: 2-way from Field et al. (2012) Discovery Statistics Using R
table3 <- apa.2way.table(iv1 = gender, iv2 = alcohol, dv = attractiveness,
data = goggles, table.number = 3)
# Save both Table 2 and Table 3 in a single .doc document
apa.save(filename = "my_tables.doc", table2, table3)
# Create a table for your PDF
# Include the lines below in your rmarkdown or Quarto document
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.