|
The data set is from a study described in Reisby et. al., (1977) that focused on the longitudinal relationship between imipramine (IMI) and desipramine (DMI) plasma levels and clinical response in 66 depressed inpatients (37 endogenous and 29 non-endogenous). Following a placebo period of 1 week, patients received 225 mg/day doses of imipramine for four weeks. In this study, subjects were rated with the Hamilton depression rating scale (HDRS) twice during the baseline placebo week (at the start and end of this week) as well as at the end of each of the four treatment weeks of the study. Plasma level measurements of both IMI and its metabolite DMI were made at the end of each week. The sex and age of each patient were recorded and a diagnosis of endogenous or non-endogenous depression was made for each patient.
Although the total number of subjects in this study was 66, the number of subjects with all measures at each of the weeks fluctuated: 61 at week 0 (start of placebo week), 63 at week 1 (end of placebo week), 65 at week 2 (end of first drug treatment week), 65 at week 3 (end of second drug treatment week), 63 at week 4 (end of third drug treatment week), and 58 at week 5 (end of fourth drug treatment week). The sample size is 375. Data for the first 10 observations of all the variables used in this section are shown below in the form of a SuperMix spreadsheet file, named reisby.ss3.

The variables of interest are:
- Patient is the patient ID (66 patients in total).
- HDRS is the Hamilton depression rating scale.
- Week represents the week (0, 1, 2, 3, 4 or 5) at which a measurement was made.
- ENDOG is dummy variable for the type of depression a patient was diagnosed with (1 for endogenous depression and 0 for non-endogenous depression).
- WxENDOG represents the interaction between Week and ENDOG, and is the product of Week and ENDOG.

Mathematical model
A general two-level model for a continuous response variable depending on a
set of predictors can be expressed
as

where
denotes the value
of for the level-1 unit nested within the thelevel-2 unit for and , the scalar product is the fixed part of the model, and and denote the random part of the model at levels 2 and 1 respectively. For the fixed part of the model, is a typical row of a design matrix while the vector contains the fixed, but unknown parameters to be estimated. In the case of the random part
of the model at level 2, represents a
typical row of a design matrix , and the vector of
random level-2 effects to be estimated. It is assumed that are independently
and identically distributed (i.i.d.) with mean vector 0 and covariance matrix . Similarly, the are assumed i.i.d., with mean vector . The elements of are typically a
subset of those .
The random intercept and slope model
The random intercept and slope model for
the response variable HDRS
may be expressed as
where denotes the
average expected depression rating scale value, denotes the
coefficient of the predictor variable Week
(slope) in the fixed part of the model  HDRS value over patients and between
patients respectively.
The random intercept and slope with a covariate
and an interaction model
The random intercept and slope model for
the response variable HDRS
with the variable ENDOG
as a covariate and with an interaction effect between Week ENDOG
may be expressed as
where   Week and ENDOG in the fixed part of the model denotes the
coefficient of the interaction and ENDOG in the fixed part of the model,  and denote the
variation in the average expected value over patients and over
measurements (i.e., between patients) respectively.

Preparing the data
The random intercept and slope model above is fitted to the data in reisby.ss3. The first step is to create the ss3 file shown above from the Excel file reisby.xls. This is accomplished as follows.
- Use the Import Data File option on the File menu to load the Open dialog box.
- Browse for the file reisby.xls in the Examples, Continuous folder.
- Select the file and click on the Open button to open the following SuperMix spreadsheet window for reisby.ss3.
After selecting the File, Save option, we are ready to fit the random intercept and slope model for HDRS to the data in reisby.ss3.
Setting up the analysis
Start by selecting the New Model Setup option on the File menu as shown below to load the Model Setup window. The Model Setup window has six tabs: Configuration, Variables, Starting Values, Patterns, Advanced, and Linear Transforms. In this example, only the Configuration and the Variables tabs are used.
After selecting the File, Save option, we are ready to fit the random intercept and slope model for HDRS to the data in reisby.ss3.
Click the Variables tab to proceed to the Variables screen of the Model Setup window . This screen shows the list of variables available for analysis and next to it two columns, with headings E (for explanatory variables) and 2 (for level-2 random effects). The variable Week is specified as the covariate of the fixed part of the model by checking the E check box for Week in the Available grid . We mark the 2 check box for Week in the Available grid to specify the random slope at level 2 of the model. After completion, the Variables screen should look as shown below.
Before the analysis can be run, the model specifications have to be saved to file. To accomplish this, we select the Save As option on the File menu to load the Save Mixed Up Model dialog box and then enter the name depress.mum in the File name text box to produce the following Save Mixed Up Model dialog box.
The analysis is run by selecting the Run option from the Analysis menu as shown below
to produce the
corresponding output file depress.out.
Discussion of results

Three separate sections of the output file depress.out are shown below. The summary of the hierarchical structure of the data below, which is given first, shows how the 375 measurements are nested within the 66 patients. It also indicates that the number of repeated measurements per patient varies from 4 to 6 observations.

The following portion of the output file
consists of a listing of selected descriptive statistics of the variables
of the model. The descriptive results
show, for example, that the mean HDRS
score is 17.64 with a standard deviation of 7.19.

The next part of the output file contains the
final estimates of the fixed and random coefficients included in the model, along with some
goodness of fit measures. The results given below show
that the p-values for the time effect, as represented by the variable WEEK, is highly significant. At the beginning
of the study, when WEEK = 0, the average
expected HDRS score is 23.57695.
For each subsequent week, a decrease of -2.37707 in average HDRS score is expected. At the end of the
study period, the average expected HDRS score is 23.57695 - 5(2.37707) = 11.6916.
The p-values for the estimates of the
random coefficients are also significant, with the exception of that for the
covariance between the intercept and slope. From the output above we have
= 12.62930,
= 2.07899,
= -1.42093, and
that
= 12.21663. It is
clear that there is considerably more variation in patients' intercepts than in
their slopes (12.62930 vs. 2.07899). This indicates that there are significant
differences in the initial HDRS scores, but that the patients' slopes over time do not vary as much. This seems
to indicate that the pattern in HDRS scores over time may be similar for patients, although they start with markedly
different initial HDRS scores. Typically,
one would expect most of the variation in HDRS scores at the measurement level, and thus would expect
to be larger than
any of the other variances/covariances. In this case,
however, there is more variation in the random intercept is over patients than in the measurements
nested within patients. Due to this, it may be of interest to take a closer
look at the variation in HDRS scores at the
two levels of the hierarchy.
In the case of a model with only a random
intercept, there are two variances of interest
: the variation in the random
intercept
over the patients, and the residual
variation at level-1
, over the measurements. By
calculating the total variation in the HDRS score explained by such a model, obtained
,we can obtain an estimate of the intracluster correlation coefficient.
The intracluster coefficient is defined as
and would, for a
random intercept model
for this data, represent the proportion
in HDRS scores between patients.
In the current model, which contains both a
random intercept and a random slope
, the situation is somewhat more complicated.
This is due to the possible correlation between the level-2 random effects.
When calculating an estimate of the total variation, the covariance(s) between
random effects have to be taken into account in any attempt to estimate the
proportion of variation in outcome at any level or for any random
coefficient. In addition, the inclusion of a covariate such as ENDOG can affect the variance estimates.

The total variation
in HDRS scores over patients is defined as
The total variation is a function of the value assumed by the
predictor WEEK, which has a random
slope. As such, the total variation at the beginning
of the study is
while at the end of
the study we have
An estimate of the total variation at this level can be obtained by using
the estimates of the variances and covariance obtained under this model. By substituting
,
, and
into the
equations above, we obtain the estimated variation in HDRS scores over patients
at different points during the study period.
At the beginning of the study, the estimated
total variation in HDRS scores over patients is simply the estimated variation in the random intercept
, i.e.
= 12.62930. At
the end of the study, the total variation at level-2 is estimated as
At the beginning of the study we obtain
and thus conclude
that that 50.8% of the variation in HDRS
scores at this time is over patients. At the end of the study, we find that
so that only 20% of the variation in HDRS scores are estimated to be at the measurement level, with 80% at the patient level. As mentioned before, the total variation in HDRS scores is a function of the time of measurement, as represented by the variable WEEK. The very different estimates of variation at a patient level show how the introduction of an important predictor, in this case at the measurement level, can have an impact on variance estimates at a different level of the hierarchy. By the end of the study period, the residual variation over measurements has been dramatically reduced, this being explained to a large extent by the inclusion of the time effect. Most of the remaining unexplained variation is at the patient level. As a result of this finding and in the light of our original research question, whether the initial depression classification of a patient is also related to the HDRS scores over the time in which medication is administered, the model will be extended to include the covariate ENDOG. This dichotomous variable assumes a value of 1 when endogenous depression was observed, and 0 if not. In addition, we will make provision for a possible interaction between depression classification and the measurement occasion by including the interaction term WxENDOG in the model. While WxENDOG can be viewed as a cross-level interaction , as WEEK is a measurement-level variable and ENDOG a patient-level variable, the inclusion of the patient-level variable ENDOG may enable us to explain more of the remaining variation in the random intercept s and slopes at the patient level.

|