Initialize R
with the following commands:
options(contrasts=c("contr.sum","contr.poly") )
load(file=url("http://pnb.mcmaster.ca/bennett/psy710/datasets/practice1-2022.rda") )
The options
command sets up R to use sum-to-zero coding
for factors, and polynomial coding for ordered factors. The
load
command loads the data variables that you need to
answer the following questions.
Verbal IQ scores were obtained from 30 children. The data are stored
in the variable iq.dat
, which was placed into R with the
load
command above. Use the data in iq.dat
to
answer the following questions.
1.1. Use a \(t\) test to evaluate the null hypothesis that the data were sampled from a population with a mean of 100. Make sure answer includes the values of \(t\), \(p\), and the degrees of freedom, and a clear description of the null and alternative hypotheses being evaluated.
1.2. Calculate Cohen’s \(d\).
1.3. Cohen’s \(d\) is a common measure of effect size. What, exactly, does Cohen’s \(d\) represent? Why is a measure like Cohen’s \(d\) a useful complement to \(p\) values?
1.4. The IQ test was designed so that, in a population of typically-developed children, the mean score is 100 and the standard deviation is 15 (\(\mu=100\), \(\sigma=15\)). Use an equivalence test to evaluate the hypothesis that our sample was selected from a population with a normal mean, with the assumption that a mean is considered normal if it is within the bounds \(100 \pm \frac{\sigma}{2}\), or \(100 \pm 7.5\). State the null and alternative hypotheses for the equivalence test, and your conclusion regarding that null hypothesis.
A perceptual learning experiment measured visual sensitivity in a
group of 40 young adults before and after practice in visual detection
tasks. The data are contained in the data frame paired.df
:
visual sensitivity measures taken before and after practice are stored
in the variables t1
and t2
.
2.1. Use a \(t\) test to see if the two measures differ significantly. State the null (H0) and alternative (H1) hypotheses, as well as your conclusion about H0.
2.2. What does the \(p\) value of your \(t\) test mean? In other words, the \(p\) value is a probability, but a probability of what?
An experiment was conducted to assess the effects of four treatments
on a dependent variable, y
. The experiment measured
y
on 32 subjects assigned randomly to the four treatments
(\(n=8\) per treatment), and the data
are stored in the data frame aov.df
. Use
aov.df
to answer the following questions.
3.1 Calculate the mean and standard deviation of y
for
each treatment group.
3.2 Conduct an analysis of variance to evaluate the effect of
treatment
on y
. Record the results of your
ANOVA (i.e., write the ANOVA table).
3.3 Explain the null and alternative hypotheses that are evaluated by your ANOVA.
3.4 Our ANOVA makes assumptions about the distribution of the errors: specifically, that the errors are distributed normally and have constant variance across groups. Use statistical (i.e., not graphical) methods to evaluate these assumptions.
3.5 Evaulate the pairwise differences between all group means.
3.6 Explain what is meant by Type I errors and how they relate to your analysis of pairwise differences.
3.7 What does eta-squared (\(\eta^2\)) represent? Calculate \(\eta^2\) for treatment
.
The results of an ANOVA are shown below. Refer to the ANOVA table when answering the questions in this section.
## Analysis of Variance Table
##
## Response: y
## Df Sum Sq Mean Sq F value Pr(>F)
## group 3 101.57 33.856 3.2941 0.03136 *
## Residuals 36 370.00 10.278
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
4.1. When the null hypothesis is true, what do the values \(\mathit{MS}_{\mathit{group}}\) and \(\mathit{MS}_{\mathit{residuals}}\) represent?
4.2. The sums-of-squares for group
is 102. In the
context of nested linear models that were used to construct this table,
what does this value represent?
4.3. The degrees of freedom for group
is 3, which equals
the number of groups minus 1. The degrees of freedom for group also
corresponds to a particular difference between two nested linear models
that are used to construct the ANOVA table. What is this difference?
Use aov.df
to answer the following questions.
5.1. Evaluate a linear comparison between the mean of treatment 1 and the mean of the other three treatments. Assume that your comparison is planned.
5.2. Perform the same contrast, but now assume that it was done after looking at the data.
5.3. List a set of weights that could be used to evaluate a linear contrast that is orthogonal to the contrast tested in the previous two questions. Describe the null hypothesis that is evaluated by your contrast weights.
An experiment measured detection thresholds for spots of different
sizes. The point of the experiment was to test a prediction that
detection threshold would decline as the spot increased from small to
medium, but then would level off or actually increase as spot size
increased from medium to large. The experiment measured detection
thresholds for spots at six, equally-spaced diameters ranging from small
(condition d1
) to large (condition d16
). There
were 6 subjects per condition. The data are stored in the data frame
spot.dat
which consists of the factor diameter
and the numeric variable threshold
.
6.1. Evaluate the linear and quadratic trends of
threshold
across diameter
.
6.2. Calculate effect size and association strength for the quadratic trend.