Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with new mixed models in ANOVA in SPSS 11

483 views
Skip to first unread message

ji...@umich.edu

unread,
Mar 23, 2002, 9:14:17 PM3/23/02
to
Hello, I have been to our campus stat consultants and got a bit of
help with trying to do a repeated measures (within subjects) analysis
in SPSS 11 using a rather different approach from previous methods,
and am not sure if it is really the appropriate analysis, or quite how
to set it up.

He suggested I use the mixed models analysis. Unfortunately, my visit
with them was a bit too brief and I'd like to try and do this analysis
before my next appointment with them in a week. I'm afraid being a
university site license edition, no documentation is available except
the syntax guide and online help, which I've been fishing in but
without much progress.

Generally speaking, suppose a two-factor design, drug (A or B) X dose
(Small or Large). Observation is real number I, improvement.

Data for each patient is collected on successive days and is arranged
as:

Patient Drug Dose Improvement
1 A S 5.23
1 A L 6.67
1 B S 3.23
1 B L 4.21
2 A S 4.13
2 A L 5.32
2 B S 2.67
2 B L 3.19
-
-
-
-


This is ordered for clarity, assume order of Drug and Dose are
counterbalanced over the four days.


Using the repeated measures opton under GLM in SPSS 10, one would
first rearrange the data in fashion:

5.23 6.67 3.23 4.21
4.13 5.32 2.67 3.19

then associate each column with one combination of factor levels
(e.g., column 1 = Drug 1 Dose 1, column 2 = Drug 1 Dose 2, etc.), then
perform the analysis.

Patient is a random factor, Drug and Dose are fixed effects.

I don't understand

1) is this appropriate for the mixed models analysis? From the online
help, it seems it may only be appropriate when there is a numerical
covariate. I'm wondering if the consultant directed me to mixed models
because I mentioned there might be an order effect from day
administered, and he wanted to treat this as a covariate. For now, I
do not want to look at that, but might later. Do I need this analysis
or should I stick with GLM repeated measures?

2) In fact this is an abstraction of my actual experiment. The data
for each patient includes multiple observations at each combination of
factor levels, ie., there are 25 instances of Drug A Dose S for
patient 1.

Is this why when I tried the mixed models approach with Drug and Dose
as fixed effects, patient as random effect, and Improvement as the DV,
and day of administration as a covariate, I got the error

Warnings
The levels of the repeated effect are not different for each
observation within a repeated subject.
This command is not executed.

Thanks much for any assistance....

Jim

Iain T. Johnstone

unread,
Mar 24, 2002, 5:34:12 PM3/24/02
to
Hi Jim,

I'm fairly new to the SPSS mixed models approach myself, but from
converstions with others, reading some books and one useful reply to a
question on this list from an SPSS statistician (thanks Wai-Tung), I might
be able to help.

First off, the way to enter your data is more or less as you have it laid
out below, but with the addition of a time or order factor, thus:

Patient Time Drug Dose Improvement
1 1 A S 5.23
1 2 A L 6.67
1 3 B S 3.23
1 4 B L 4.21
2 1 A S 4.13
2 2 A L 5.32
2 3 B S 2.67
2 4 B L 3.19

Now, the thing that needs to be worked out with this approach is the
structure of the within-subjects covariance matrix, which reflects the
fact that measures taken on the same subject at different times will tend
to be correlated. One common covariance structure is a first-order
autoregressive structure, in which correlations tend to get smaller the
further apart in time the measures become. If this is the case, then you
can run the following model:

MIXED IMPROV BY DRUG DOSE TIME
/FIXED = TIME DRUG DOSE
/REPEATED = TIME | SUBJECT(PATIENT) COVTYPE(AR1)

Keep in mind that in this command, the REPEATED sub-command is not the
same as in GLM Repeated Measures. Here, REPEATED designates which variable
is the one to be used to desginate the order of observations, for
modelling the autoregressive covariance structure. Because the TIME
variable will have a unique value for each observation on a given patient,
you will not get the error message you mentioned.Of course the validity of
using such a technique hinges upon the accurate modelling of the
within-subjects covariance structure.

Hope this helps, and perhaps spurs some discussion here of the pros and
cons of using the mixed-model approach to analysing repeated measures
data.

Tom

jimkk...@umich.edu

unread,
Mar 24, 2002, 6:29:45 PM3/24/02
to
Thanks very much Tom, that's a big help. Yes I followed your thread
too. In multivariate repeated measures analysis allowance is present
for the fact that measures within a subject are not independent. It
sounds like with this mixed model AR1 approach, one assumes covariance
locally (in time) within a subject. This is probably correct. But I
wonder if this approach treats the first and last measures within a
subject as also fcorrelated, as they surely are more than the first
measure in subject x is correlated with the last measure in subject y.
So I wonder if this mixed model approach really sufficiently handles
lack of independence within subject. Also I'm a bit unclear on whether
this approach just replaces the multivariate approach of using subject
as a random variable to account for non-independence within subject,
or is specifically designed for the purpose of looking at a factor
that covaries in time with the IVs. So, I'm interested in keeping up
with any further discussion here on the topic.

Thanks again,
Jim

Watch out for spam block

Iain T. Johnstone

unread,
Mar 25, 2002, 1:42:43 AM3/25/02
to
jimkk...@umich.edu wrote:

> Thanks very much Tom, that's a big help. Yes I followed your thread
> too. In multivariate repeated measures analysis allowance is present
> for the fact that measures within a subject are not independent. It
> sounds like with this mixed model AR1 approach, one assumes covariance
> locally (in time) within a subject. This is probably correct. But I
> wonder if this approach treats the first and last measures within a
> subject as also fcorrelated, as they surely are more than the first
> measure in subject x is correlated with the last measure in subject y.

I believe it does. In other words, although correlations get smaller the
further apart two (within-subject) observations are, they do not necessarily
reach zero when a long time separates them.

> So I wonder if this mixed model approach really sufficiently handles
> lack of independence within subject.

I also have this lingering question. I would like to learn more about assessing
the goodness of the covariance structure chosen.

> Also I'm a bit unclear on whether
> this approach just replaces the multivariate approach of using subject
> as a random variable to account for non-independence within subject,
> or is specifically designed for the purpose of looking at a factor
> that covaries in time with the IVs.

I originally thought I should not only include subject as a random factor but
also the subject*within-subjects interactions, to account for individual
differences in how each within-subjects variable affects the DV. Also it is
possible to include an intercept term in the random effects. I will be looking
into when it is appropriate to include these terms in the model. Unfortunately,
most of the literature I have read deals with just one within-subjects,
time-ordered variable, whereas my experiments usually deal with more that one
experimental manipulation that are randomized in time.

Tom

Wai-Tung Ho

unread,
Mar 26, 2002, 3:24:01 PM3/26/02
to
Actually, one can use a combination of /RANDOM and /REPEATED to model
the within subject covariance structure of repeated measure data.

Suppose we look at the i-th subject only, the model will be

Y_i = X_i*beta + Z_i*gamma_i + error_i

Y_i = a vector of observations from i-th subject

X_i = design matrix of fixed effects (those in /FIXED)
of i-th subject
beta = a vector of fixed effect parameters, these are
parameters appear in "Estimates of Fixed Effects"
table.
Z_i = design matrix of random effects (those in /RANDOM)
of i-th subject
gamma_i = a vector of random effect parameters

error_i = a vector of error term, the covariance structure
is specified by (/REPEATED)

Based on these notation, the covariance matrix of the a subject can be
written as

COV(Y_i) = [Z_i * G * Z_i'] + R

So when you use a random effect, the covariance matrix of each subject
may be different because the random effect design matrix Z_i may be
different for each subject. Lets look at an example based on the
syntax given in previous post,

MIXED IMPROV BY DRUG DOSE TIME
/FIXED = TIME DRUG DOSE

/RANDOM = DRUG |SUBJECT(PATIENT) COVTYPE(ID)
/REPEATED = TIME | SUBJECT(PATIENT) COVTYPE(ID)

Say DRUG has 2 levels and TIME has 4 levels. Then R is a 4 dimension
diagonal matrix, G is a 2 dimension diagonal matrix and Z_i will be a
4 by 2 matrix. With some matrix algebra, you can check that the within
subject covariance matrix will now have a block diagonal structure,
whereas each block correspond to 1 drug.

But be careful when you use both /RANDOM and /REPEATED together, it is
quite easy to create a non-identified model and you will run into
estimation problems.

Hope this answer some questions of you guys.

Wai-Tung
Statistician
SPSS Inc.

"Iain T. Johnstone" <john...@psyphw.psych.wisc.edu> wrote in message news:<3C9EC6E3...@psyphw.psych.wisc.edu>...

0 new messages