For all of the questions below, hand in (on the due date) the
relevant snippets of output from MATLAB, such as command-window output
or graphical output or M-file code. Please do not waste trees by
printing pages and pages of irrelevant output.
- Study the ethics of administering experiments to human
participants.
The goal of this exercise is for you to be
aware of ethical considerations when creating and running
experiments.
- Explore the replication of the experiment.
The goals of this exercise are to understand how to program an
experiment in Matlab and to generate data for analysis and
modeling. RUN THE EXPERIMENT AS SOON AS POSSIBLE SO THAT
THE DATA FILES CAN BE POSTED. You get credit for this exercise when
you e-mail your data file to Prof. Kruschke. Load NHA65CW.m into your directory and run it,
following the directions.
After running the program, for your own edification, notice the
sections of the program. These sections will be ordered much the same
way in most experiments, including the one you will eventually program
for your own project. Notice the way, in Matlab, that information is
gathered from the user and the way data are stored. There are many
subtleties in numeric and string and cell formatting; get used to
reading the Matlab help files!
- Data analysis.
The goal of this exercise
is for you to explore aspects of data analysis in Matlab, and to see
whether our replication data match the 1965 data.
- Get the 2005 class data files from this
link. Do this only after at least 15 people (in 2005) have
contributed data. Copy each one into your own directory, being sure
that there are no extra blank lines inserted between rows. (This might
be a little tedious, but it only takes a few minutes.) The program,
NHA65mergedata.m, merges individual
data files into a master file. Study this program so that you are
familiar with how files are read. Merge the data files using this
program. In your projects, you will have to do something like this,
i.e., merge the data, as individuals e-mail you their data.
- The program, NHA65stats.m, performs
descriptive and inferential statistics on the master data file. Run
the program.
A. On the boxplot, mark any non-monotonicities of
the medians. Also, mark any outliers (e.g., circle or highlight
them).
B. Look at the program and extend the t-test section to
include the two additional tests indicated. Show the output of the
tests.
C. Consider the results of the t-tests. Are the
predictions of the averaging model confirmed?
- Fit the averaging model to the data.
The
goal of this exercise is to explore the model and its ability to fit
the data. Copy the averaging
model into your directory. Read the comment section at the top of
that file. In particular, read about the extension of the model to
make it probabilistic, for which an extra parameter (n) is needed.
Notation: VH is the underlying psychological value of a
high trait. H is the overt rating given to a high trait.
- Anderson (1965) seems to claim that, if VH >
VMp and that VL < VMm, then the
(deterministic) averaging model predicts H > H.Mp and L <
L.Mm. Is that always true? That is, are there parameter values for
which that is not true? If so, give an example of such
parameter values. (Hint: Pick some constant values for VH
> VMp > VI. Then compute the predicted
ratings for H and H.Mp as a function of the value of the averaging
weight, w. Again, this is for the deterministic model; don't include
the noise term.)
- Try fitting the model to (mean) data that are actually generated
by the (deterministic) model. (When doing your fit, make sure that the
number of iterations in fminsearch is set high enough that it
converges. In the output, 'exitflag' should not be 0.) Specifically,
let VL=0, VMm=20, VMp=75,
VH=95, VI=65 and w=0.7. Compute the predicted
ratings for the 10 conditions (which you can easily do by scavenging
snippets of code from the averaging model and putting into a new
Matlab program). Now use those predicted ratings as data to be fit by
the model. Initialize fminsearch at [ 0 25 75 100 50 0.5 10 ]. Does
fminsearch settle onto the parameter values that generated the data?
Try initializing the search with the correct parameter values. Does
fminsearch stay there or stray away?
- Now fit the model to the mean of the class data. (When doing your
fit, make sure that the number of iterations in fminsearch is set high
enough that it converges. In the output, 'exitflag' should not be 0.)
Report the results for the following initial parameter vectors:
[
0 25 75 100 50 0.7 20 ]
[ 0 25 75 100 50 0.1 20 ] What is the
effect of small w?
[ -10 20 80 110 50 0.7 20 ] Is it okay to
have values <0 or >100?
[ 0 25 75 100 80 0.7 20 ] What is
the effect of large I?
- The previous part found the maximal likelihood estimates of the
parameters. If we were instead taking a Bayesian approach to parameter
estimation, what would we do? Don't actually do the Bayesian approach;
just briefly describe the steps involved if we were to apply it to the
averaging model.