Learn R Programming

AMCP (version 2.0.0)

chapter_7_table_16: The data used in Chapter 7, Table 16

Description

The data used in Chapter 7, Table 16

Usage

data(chapter_7_table_16)

Arguments

Format

An object of class data.frame with 22 rows and 3 columns.

Variables

Sex

gender (male vs female)

Education

education level (degree vs no degree)

Salary

salary (in thousands)

Synonym

C7T16

Author

Ken Kelley kkelley@nd.edu

Details

The following hypothetical salary data represents a nonorthogonal two-by-two factorial design. The first factor (sex) is crossed with college (degree or no degree). The primary question of interest is whether or not there is sex discrimination in terms of salary.

The data in Table 7.16 presents hypothetical data (in thousands) for 12 females and 10 males who have just been hired by the organization. The mean salary for the 12 females is $22,333, whereas the mean for the 10 males is $22,100. The data in Table 7.16 also contains information about an additional characteristic of employees, namely whether they received a college degree. It is clear from the data that a majority of the new female employees are college graduates, whereas a majority of the males are not.

References

Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). New York, NY: Routledge.

Examples

Run this code
# Load the data
data(chapter_7_table_16)

# Or, alternatively load the data as
data(C7T16)

# View the structure
str(chapter_7_table_16)

# ---------------------------------------------------------------------
# Optional: a factor-coded copy for model-comparison analyses / plotting.
# Sex and Education are stored as numeric codes so the book's examples
# reproduce exactly. Build a *copy* (suffix "_factors") so the canonical
# data set is left unchanged; Salary stays numeric. The level order is
# fixed by the counts in the narrative: the data have 12 cases in Sex == 1
# and 10 in Sex == 2, matching the "12 females and 10 males", and the
# female majority are graduates, so Education == 1 is the degree group.
C7T16_factors <- chapter_7_table_16
C7T16_factors$Sex <- factor(C7T16_factors$Sex, levels = 1:2,
  labels = c("Female", "Male"))
C7T16_factors$Education <- factor(C7T16_factors$Education, levels = 1:2,
  labels = c("Degree", "No Degree"))

# This is a NONORTHOGONAL (unbalanced) two-way design, so the sums of
# squares are order-dependent; the book reports the appropriate tests.
# Build the factor copy, then follow the book's procedure (e.g.,
# car::Anova() for Type II/III) rather than the default anova(lm()).
str(C7T16_factors)

Run the code above in your browser using DataLab