# The minimalBSExample contains $n$ of 175 participants categorized according
# to one factor $f = 1$, namely `State of residency` (with three levels)
# for 3 possible cells.
minimalBSExample
# Lets incorporate the data in an ANOPA data structure
w <- anopa( {s;n} ~ state, minimalBSExample )
# The data presented using various formats looks like
toWide(w)
# ... has 175 lines, one per participants ($n$) and 2 columns (state, success or failure)
toLong(w)
# ... has 175 lines ($n x f$) and 4 columns (participant's `Id`, state name, measure name,
# and success or failure)
toCompiled(w)
# ... has 3 lines and 3 columns ($f$ + 2: number of succes and number of participants).
# This second example is from a mixed-design. It indicates the
# state of a machine, grouped in three categories (the sole between-subject
# factor) and at four different moments.
# The four measurements times are before treatment, post-treatment,
# 1 week later, and finally, 5 weeks later.
minimalMxExample
# Lets incorporate the data in an ANOPA data structure
w <- anopa( cbind(bpre,bpost,b1week,b5week) ~ Status,
minimalMxExample,
WSFactors = "Moment(4)" )
# -- Wide format --
# Wide format is actually the format of minimalMxExample
# (27 lines with 8 subjects in the first group and 9 in the second)
toWide(w)
# -- Long format --
# (27 times 4 lines = 108 lines, 4 columns, that is Id, group, measurement, success or failure)
toLong(w)
# -- Compiled format --
# (three lines as there are three groups, 7 columns, that is,
# the group, the 4 measurements, the number of particpants, and the
# correlation between measurements for each group measured by unitary alphas)
toCompiled(w)
Run the code above in your browser using DataLab