control
),
were evaluated. For this study, six factories were selected randomly
from a large population. The six factories were assigned randomly to the
three assembly fixtures, with the constraint that each type of
fixture
was tested in two factories. Five
workers
in each factory were randomly selected from the
entire workforce to participate in the study. After a three-week
familiarization period, the experimenters measured the assembly
rate
(units assembled per hour) for each participant. In
this experiment, fixture
is fixed and factory
is random, and factory is nested within fixture. The data are stored in
the data frame electronics
which can be loaded and
inspected with the following commands:load(url("http://pnb.mcmaster.ca/bennett/psy710/datasets/electronics.rda") )
sapply(electronics,class)
xtabs(~fixture + factory,data=electronics) # factory nested in fixture
Evaluate the statistical significance of the fixed effect of
fixture
and the random effect of
factory
.
Compute association strength for fixture
and
factory
.
glycogen
were made on each sample for a
total of 36 measures. The data are stored in the data frame
liver
which can be loaded with the following command:load(url("http://pnb.mcmaster.ca/bennett/psy710/datasets/liver.rda") )
sapply(liver,class)
## glycogen treatment rat sample measure
## "integer" "factor" "factor" "factor" "factor"
# summary(liver)
# xtabs(~treatment + rat,data=liver) # rat nested in treatment
# xtabs(~rat+sample,data=liver) # sample nested in rat
In this experiment, glycogen
is the dependent variable,
treatment
is a fixed factor and rat
and
sample
are random factors. Note that rat
is
nested within treatment
and sample
is nested
within rat
. The factor sample
contains 18
unique levels, with each level representing one of the three samples
taken from the six rats. The data frame also contains the factor
measure
, which you can think of as the ID for each glycogen
measure (similar to the way subjects often are identified by an ID).
Evaluate the effect of treatment
on
glycogen
while ignoring the random effects and
nested structure of the data.
Evaluate the statistical significance of the fixed effect of
treatment
on glycogen
using a model that
includes the random/nested factors. Does the effect of
treatment
differ from the one estimated in the previous
question? Why or why not?