Learn R Programming

datarium (version 0.2.0)

stress: Stress Data for Two-Way ANCOVA

Description

Researchers want to evaluate the effect of a new "treatment" and "exercise" on the stress score reduction after adjusting for "age".

Two-way ANCOVA can be performed in order to determine whether there is interaction between exercise and treatment on the stress score.

It is the data set used in the Datanovia tutorial “ANCOVA in R: Compare Group Means Adjusted for a Covariate” (https://www.datanovia.com/learn/biostatistics/anova/ancova-in-r).

Usage

data("stress")

Arguments

Format

A data frame with 60 rows and 5 columns (stored as a tibble).

id

participant identifier (1 to 60).

score

the stress score; a simulated measure on an arbitrary scale with no real-world units.

treatment

whether the participant received the treatment, "yes" or "no".

exercise

the exercise level, "low", "moderate" or "high".

age

the participant's age, in years.

See Also

Examples

Run this code
data(stress)
head(stress)

# Two-way ANCOVA of the stress score, adjusting for age
summary(aov(score ~ age + treatment * exercise, data = stress))

Run the code above in your browser using DataLab