Learn R Programming

datarium (version 0.2.0)

anxiety: Anxiety Data for Two-Way Mixed ANOVA

Description

The data provide the anxiety score, measured at three time points, of three groups of individuals practicing physical exercises at different levels (grp1: basal, grp2: moderate and grp3: high)

Two-way mixed ANOVA can be used to evaluate if there is interaction between group and time in explaining the anxiety score.

It is the data set used in the Datanovia tutorial “Mixed ANOVA in R: One Between- and One Within-Subjects Factor” (https://www.datanovia.com/learn/biostatistics/anova/mixed-anova-in-r).

Usage

data("anxiety")

Arguments

Format

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

id

participant identifier (1 to 45).

group

the physical exercise level, "grp1" (basal), "grp2" (moderate) or "grp3" (high); a between-subjects factor.

t1

the anxiety score at the first time point.

t2

the anxiety score at the second time point.

t3

the anxiety score at the third time point.

The anxiety score is a simulated measure on an arbitrary scale with no real-world units.

See Also

Examples

Run this code
data(anxiety)
head(anxiety)

# Two-way mixed ANOVA: group (between) x time (within)
anxiety_long <- reshape(anxiety, varying = c("t1", "t2", "t3"),
                        v.names = "score", timevar = "time",
                        direction = "long")
summary(aov(score ~ group * factor(time) + Error(factor(id)/factor(time)),
            data = anxiety_long))

Run the code above in your browser using DataLab