Learn R Programming

AMCP (version 2.0.0)

chapter_7_table_9: The data used in Chapter 7, Table 9

Description

The data used in Chapter 7, Table 9

Usage

data(chapter_7_table_9)

Arguments

Format

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

Variables

Score

blood pressure

Feedback

biofeedback condition (1 = present, 2 = absent, that is, drug administered alone)

Drug

drug administered (1 = drug X, 2 = drug Y, 3 = drug Z)

Synonym

C7T9

Author

Ken Kelley kkelley@nd.edu

Details

Table 7.9 gives one additional observation for each of the six cells of the 2 (biofeedback: present or absent) by 3 (drug: X, Y, or Z) blood pressure design whose first five observations per cell appear in Table 7.5 (chapter_7_table_5). The additional observations are listed in the same cell order as Table 7.5: biofeedback paired with drug X, Y, and Z, followed by drugs X, Y, and Z administered alone. Stacking these six values onto Table 7.5 yields six observations per cell, and the cell means and marginal means of the combined data are those reported in Table 7.10 (reproduced in the examples below).

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_9)

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

# View the structure
str(chapter_7_table_9)

# ---------------------------------------------------------------------
# Table 7.9 supplies one additional observation for each of the six cells
# of the 2 (Feedback) x 3 (Drug) design in Table 7.5 (chapter_7_table_5).
# Stacking it onto Table 7.5 gives six observations per cell; the cell and
# marginal means of the combined data are those reported in Table 7.10.
data(chapter_7_table_5)
combined <- rbind(chapter_7_table_5, chapter_7_table_9)

# Cell means: a 2 (Feedback) x 3 (Drug) table -- Table 7.10
#   Feedback 1 = biofeedback present, 2 = absent; Drug 1 = X, 2 = Y, 3 = Z
tapply(combined$Score,
       list(Feedback = combined$Feedback, Drug = combined$Drug), mean)

# Marginal means and grand mean (also given in Table 7.10)
tapply(combined$Score, combined$Feedback, mean)  # 187 (present), 199 (absent)
tapply(combined$Score, combined$Drug, mean)      # 178 (X), 202 (Y), 199 (Z)
mean(combined$Score)                             # 193 (grand mean)

Run the code above in your browser using DataLab