apa.2way.table: Creates a table of means and standard deviations for a 2-way...

View source: R/apaANOVATable2way.R

apa.2way.tableR Documentation

Creates a table of means and standard deviations for a 2-way ANOVA design in APA style

Description

Creates a table of means and standard deviations for a 2-way ANOVA design in APA style

Usage

apa.2way.table(
  iv1,
  iv2,
  dv,
  data,
  filename = NA,
  table.number = 0,
  show.conf.interval = FALSE,
  show.marginal.means = FALSE,
  landscape = TRUE
)

Arguments

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

Value

APA table object

Examples

# 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")
}

dstanley4/apaTables documentation built on Feb. 16, 2024, 2:16 p.m.