icecream: Mixed factorial 2×2 design with polytomous response data

icecreamR Documentation

Mixed factorial 2×2 design with polytomous response data

Description

This synthetic long-format data set represents a survey of 40 respondents about their favorite ice cream flavors. Twenty of the respondents were adults and 20 were children. They were asked four times over the course of a year, once in the middle of each season (fall, winter, spring, summer), for their favorite ice cream flavor in that season.

This data set has a polytomous response Pref and two factors, Age and Season. The response Pref has the unordered categories {vanilla, chocolate, strawberry}. Factor Age has levels {adult, child}. Factor Season has levels {fall, winter, spring, summer}. It also has a PId column for a participant identifier. Each participant identifier is repeated four times, once for each season.

Format

A data frame with 160 observations on the following 4 variables:

PId

a participant identifier with levels "1" ... "40"

Age

a between-subjects factor with levels "adult", "child"

Season

a within-subjects factor with levels "fall", "winter", "spring", "summer"

Pref

a polytomous response with categories "vanilla", "chocolate", "strawberry"

See Also

See vignette("multpois", package="multpois") for a complete analysis of this data set.

Examples


library(multpois)
data(icecream, package="multpois")

icecream$PId = factor(icecream$PId)
icecream$Pref = factor(icecream$Pref, levels=c("vanilla","chocolate","strawberry"))
icecream$Age = factor(icecream$Age, levels=c("adult","child"))
icecream$Season = factor(icecream$Season, levels=c("fall","winter","spring","summer"))
contrasts(icecream$Age) <- "contr.sum"
contrasts(icecream$Season) <- "contr.sum"

m = glmer.mp(Pref ~ Age*Season + (1|PId), data=icecream)
Anova.mp(m, type=3)
glmer.mp.con(m, pairwise ~ Age*Season, adjust="holm")



multpois documentation built on April 3, 2025, 9:37 p.m.