# Load the data
data(chapter_7_table_24)
# Or, alternatively load the data as
data(C7T24)
# View the structure
str(chapter_7_table_24)
# ---------------------------------------------------------------------
# Optional: a factor-coded copy for model-comparison analyses / plotting.
# Therapy and Severity are stored as numeric codes so the book's examples
# reproduce exactly. The "Variables" section does not give level labels,
# so the numeric codes are kept as the factor levels. Build a *copy*
# (suffix "_factors") so the canonical data set is left unchanged; Score
# stays numeric.
C7T24_factors <- chapter_7_table_24
C7T24_factors$Therapy <- factor(C7T24_factors$Therapy)
C7T24_factors$Severity <- factor(C7T24_factors$Severity)
# This is a NONORTHOGONAL (unbalanced) two-way design with post hoc
# blocking, 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).
str(C7T24_factors)
Run the code above in your browser using DataLab