% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/documentation.R
\docType{data}
\name{chapter_5_table_4}
\alias{chapter_5_table_4}
\alias{C5T4}
\alias{Chapter_5_Table_4}
\alias{c5t4}
\title{The data used in Chapter 5, Table 4}
\format{
An object of class \code{data.frame} with 24 rows and 2 columns.
}
\source{
\url{https://designingexperiments.com/data/}

Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). \emph{Designing experiments and
analyzing data: {A} model comparison perspective}. (4th ed.). New York, NY: Routledge.
}
\usage{
data(chapter_5_table_4)
}
\description{
The data used in Chapter 5, Table 4
}
\details{
The following data consists of blood pressure measurements for six individuals randomly assigned to one of four groups. Our purpose here is to perform four planed contrasts in order to discern if group differences exist for the selected contrasts of interests.
}
\section{Variables}{

\describe{
\item{group}{a numeric vector between 1 and 4; group number}
\item{sbp}{systolic blood pressure of a patient within one of the four groups}}
}

\section{Synonym}{

C5T4
}

\examples{
# Load the data
data(chapter_5_table_4)

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

# View the structure
str(chapter_5_table_4)

# ---------------------------------------------------------------------
# Optional: a factor-coded copy for ANOVA / model-comparison analyses.
# group is stored as a numeric code so the book's contrast and
# model-comparison examples reproduce exactly. For a one-way ANOVA you
# generally want it as a factor; otherwise the code enters the model as a
# single linear (1 df) term. 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.
C5T4_factors <- chapter_5_table_4
C5T4_factors$group <- factor(C5T4_factors$group)

# The coding matters: numeric code (1 df) versus factor (3 df).
anova(lm(sbp ~ group, data = chapter_5_table_4))
anova(lm(sbp ~ group, data = C5T4_factors))
# (Chapter 5 analyzes these data with planned contrasts, which use numeric
#  contrast codes; the factor copy is for the omnibus test and plotting.)

}
\references{
Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). \emph{Designing experiments and analyzing data:
{A} model comparison perspective} (4th ed.). New York, NY: Routledge.
}
\author{
Ken Kelley \email{kkelley@nd.edu}
}
\keyword{datasets}
