load(url("http://pnb.mcmaster.ca/bennett/psy710/p3/tagalog.rda"))
sapply(tagalog.df,class)
## subjID time strategy recall
## "factor" "factor" "factor" "numeric"
tagalog.df
, which contains the factors
time
, strategy
, and subjID
, and
the numeric dependent variable recall
. (N.B. The factor
time codes the study-test intervals of 5 minutes and 2 days as
short
or long
.)Conduct an ANOVA to evaluate the fixed effects of
time
and strategy
on
recall
.
Evaluate the simple main effect of strategy
at each
level of time
. (You may use local error terms to evaluate
the simple main effects). If a simple main effect is significant,
analyze the pairwise differences among different strategies using Tukey
HSD.
load(url("http://pnb.mcmaster.ca/bennett/psy710/p3/pLearn.rda"))
summary(pLearn)
## subject accuracy stimuli day
## s1 : 4 Min. :13.00 blocked :80 d0:60
## s2 : 4 1st Qu.:44.00 fixed :80 d1:60
## s3 : 4 Median :53.00 variable:80 d2:60
## s4 : 4 Mean :53.57 d3:60
## s5 : 4 3rd Qu.:63.00
## s6 : 4 Max. :88.00
## (Other):216
sapply(pLearnWide,class)
## subject stimuli d0 d1 d2 d3
## "factor" "factor" "numeric" "numeric" "numeric" "numeric"
fixed
condition, the same set of 10
textures were used throughout the four days. In the blocked
conditions, a different set of textures was shown on each day. In the
variable
condition, a different set of 10 textures was used
on every trial.Conduct an analysis of variance to evaluate the effects of
stimuli
and day
on accuracy
.
Where necessary, correct p values for deviations from
sphericity.
Do an analysis to evaluate the linear trend \(\times\) stimuli
interaction.
If the interaction is significant, evaluate differences among the groups
using Tukey HSD. If the interaction is not significant,
determine if the average trend (i.e., ignoring stimuli
) is
significant.
Do an analysis to evaluate the quadratic trend \(\times\) stimuli
interaction.
If the interaction is significant, evaluate differences among the groups
using Tukey HSD. If the interaction is not significant,
determine if the average trend (i.e., ignoring stimuli
) is
significant.
load(url("http://pnb.mcmaster.ca/bennett/psy710/p3/liver.rda"))
summary(liver)
## condition rat sample measure glycogen
## control :12 r1:6 s1 : 2 m1 : 1 Min. :125.0
## c217 :12 r2:6 s2 : 2 m2 : 1 1st Qu.:135.8
## c217Sugar:12 r3:6 s3 : 2 m3 : 1 Median :141.0
## r4:6 s4 : 2 m4 : 1 Mean :142.2
## r5:6 s5 : 2 m5 : 1 3rd Qu.:150.0
## r6:6 s6 : 2 m6 : 1 Max. :162.0
## (Other):24 (Other):30
sapply(liver,class)
## condition rat sample measure glycogen
## "factor" "factor" "factor" "factor" "integer"
Sokal and Rohlf (1995) reported data from an experiment designed to
analyze glycogen content of rat livers. Glycogen was measured in rats in
three conditions: control, compound 217, and compound 217 plus sugar.
Each condition
used two randomly selected rats. From each
rat, the experimenters took three samples of liver, and from each sample
the experimenters took two measures of glycogen. Thus,
sample
is nested in rat
, and rat
is nested in condition
. The data are stored in the data
frame liver
, which contains the fixed factor
condition
, the random factors rat
and
sample
, and the numeric dependent variable
glycogen
.
Evaluate the statistical significance and effect size (Cohen’s f)
of condition
on glycogen
.
Estimate the variance components and association strength for
rat
and sample
.
Evaluate the statistical significance of the
random effects rat
and sample
.
What null hypotheses are being evaluated by your tests of
condition
, rat
and
sample
?
load(url("http://pnb.mcmaster.ca/bennett/psy710/p3/trigly.rda"))
summary(trigly)
## TGly tech machine
## Min. :107.5 t1:8 m1:8
## 1st Qu.:135.3 t2:8 m2:8
## Median :143.4 t3:8 m3:8
## Mean :141.2 t4:8 m4:8
## 3rd Qu.:148.6
## Max. :156.5
xtabs(~tech+machine,trigly)
## machine
## tech m1 m2 m3 m4
## t1 2 2 2 2
## t2 2 2 2 2
## t3 2 2 2 2
## t4 2 2 2 2
trigly
, which contains
the random factors tech
and machine
, and the
numeric dependent variable TGly
.Evaluate the statistical significance of the main effects of
tech
and machine
and the tech
\(\times\) machine
interaction.
Estimate the variance components and association strength for
tech
and machine
and the tech
\(\times\) machine
interaction .
load(url("http://pnb.mcmaster.ca/bennett/psy710/p3/leprosy.rda"))
summary(leprosy)
## drug baseline after
## A:10 Min. : 3.00 Min. : 0.00
## B:10 1st Qu.: 7.00 1st Qu.: 2.00
## C:10 Median :10.50 Median : 7.00
## Mean :10.73 Mean : 7.90
## 3rd Qu.:13.75 3rd Qu.:12.75
## Max. :21.00 Max. :23.00
baseline
measure of the amount of leprosy
bacilli was taken on all participants, who were then randomly assigned
to one of three drug
conditions. A second measure of
leprosy bacilli was taken after
the drug treatment. The
data are stored in the data frame leprosy
which contains
the covariate baseline
, the fixed factor drug
,
and the numeric dependent variable after
.Evaluate group differences in drug
with a one-way
ANOVA. Calculate Cohen’s f for drug
.
Evaluate group differences in Movement
with an
ANCOVA, using Baseline
as the covariate. Calculate Cohen’s
f for Group
.
ANCOVA makes the so-called homogeneity of slopes assumption. What is that assumption? Check its validity for the leprosy data.
Calculate the group means and the adjusted group means
for drug
.
Evaluate the statistical significance of all pairwise differences between adjusted group means
load(url("http://pnb.mcmaster.ca/bennett/psy710/p3/jobSatisfaction.rda"))
summary(jobSatisfaction)
## id gender education satisfaction
## s3 : 1 male :25 school :17 Min. : 4.780
## s4 : 1 female:28 college :16 1st Qu.: 5.940
## s5 : 1 university:20 Median : 6.450
## s6 : 1 Mean : 7.058
## s7 : 1 3rd Qu.: 8.700
## s8 : 1 Max. :10.000
## (Other):47
gender
, level of education
, and their job
satisfaction
score on a standard test. The data are stored
in the data frame jobSatisfaction
.Determine if the 2 (gender
) \(\times\) 3 (education
) design
is balanced.
Use ANOVA to evaluate the effects of gender
,
education
, and the gender
\(\times\) education
interaction
on satisfaction
.
Analyze the simple main effect of education
for each
gender
.
load(url("http://pnb.mcmaster.ca/bennett/psy710/p3/catfood.rda"))
summary(catfood)
## food protein
## discount:10 Min. :33.26
## original:10 1st Qu.:33.88
## Median :34.15
## Mean :34.15
## 3rd Qu.:34.53
## Max. :34.73
sapply(catfood,class)
## food protein
## "factor" "numeric"
discount
formulation
is the same as the protein content of the original
food.
The engineer measures the amount of protein
in 100 gram
samples of both formulations of the food to test whether they are
equivalent to within ±0.5 grams. The data are contained
in the data frame catfood
which contains the factor
food
and the numeric variable protein
(measured in grams).Use a 2-tailed \(t\) test to determine if the original and discount cat food differed in terms of protein.
Use an equivalence test to determine if protein levels in the two foods are equivalent (i.e., within ±0.5 grams).