UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SPSS Textbook Examples
Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence
by Judith D. Singer and John B. Willett
Chapter 3: Introducing the Multilevel Model for Change

Please note that the "early_int" data file (which is used in Chapter 3) is not included among the data files. This was done at the request of the researchers who contributed this data file to ensure the privacy of the participants in the study. Although the web page shows how to obtain the results with this data file, we regret that visitors do not have access to this file to be able to replicate the results for themselves.


Table 3.1, page 48

compute filter = 0.
if any(id,68,70,71,72,902,904,906,908) filter = 1.
filter by filter.
list id age cog program.
execute.
use all.
      ID      AGE      COG  PROGRAM

     902     1.00   119.00      .00
     902     1.50    93.00      .00
     902     2.00    99.00      .00
     904     1.00   112.00      .00
     904     1.50    98.00      .00
     904     2.00    79.00      .00
     906     1.00    89.00      .00
     906     1.50    66.00      .00
     906     2.00    81.00      .00
     908     1.00   117.00      .00
     908     1.50    90.00      .00
     908     2.00    76.00      .00
      68     1.00   103.00     1.00
      68     1.50   119.00     1.00
      68     2.00    96.00     1.00
      70     1.00   106.00     1.00
      70     1.50   107.00     1.00
      70     2.00    96.00     1.00
      71     1.00   112.00     1.00
      71     1.50    86.00     1.00
      71     2.00    73.00     1.00
      72     1.00   100.00     1.00
      72     1.50    93.00     1.00
      72     2.00    87.00     1.00


Number of cases read:  24    Number of cases listed:  24

Figure 3.1, page 50

igraph
 /x1 = var(age) type = scale
 /y = var(cog) type = scale
 /panel = var(id)
 /fitline method = regression linear line = total
 /title = 'Figure 3.1'
 /scatter coincident = none.


Figure 3.3, page 57.
igraph 
 /x1=var(age) type=scale 
 /y=var(cog) type=scale 
 /style= var(id) 
 /fitline method=regression linear line=total meffect.

We can produce the stem-and-leaf plots for the fitted initial status and the fitted rate of change as follows.

sort cases by id.
split file by id.
REGRESSION
/DEPENDENT cog
/METHOD=ENTER time
/OUTFILE=COVB('D:\alda\fig3_3.sav').

GET FILE='D:\alda\fig3_3.sav'.
FILTER OFF.
USE ALL.
SELECT IF(rowtype_ = "EST").
EXECUTE .

examine variables=const_ time/plot=stemleaf.

Constant

Constant Stem-and-Leaf Plot
 Frequency    Stem &  Leaf
     1.00 Extremes    (=<57)
     1.00        7 .  6
     2.00        8 .  23
     2.00        8 .  89
     3.00        9 .  344
    12.00        9 .  555666779999
     8.00       10 .  01222233
    14.00       10 .  55556688899999
    19.00       11 .  0000111222223333444
    13.00       11 .  5666677778888
     8.00       12 .  01122344
    11.00       12 .  55556778899
     5.00       13 .  00244
     4.00       13 .  5689
 Stem width:     10.00
 Each leaf:       1 case(s)

TIME

TIME Stem-and-Leaf Plot
 Frequency    Stem &  Leaf
     6.00       -4 .  111344
     3.00       -3 .  789
    12.00       -3 .  000001223344
    13.00       -2 .  5566777789999
    14.00       -2 .  00001111222344
    14.00       -1 .  55666677888899
    13.00       -1 .  0001122233334
    14.00       -0 .  56777788889999
     7.00       -0 .  2334444
     3.00        0 .  134
     2.00        0 .  79
     1.00        1 .  0
     1.00 Extremes    (>=20)
 Stem width:     10.00
 Each leaf:       1 case(s)

Figure 3.4, page 59

igraph 
 /x1=var(age) type=scale 
 /y=var(cog) type=scale 
 /style= var(id) 
 /panel=var(program)
 /title 'Figure 3.4'
 /scalerange=var(cog) min=50 max=150
 /fitline method=regression linear line=total meffect.


Table 3.3, page 69. Notice the warning message from SPSS output. The variance-covariance matrix is problematic. We haven't been able to coerce SPSS to converge to the right variance-covariance matrix on this model.

compute time1 = age - 1.
execute.

mixed cog with time1 program 
 /print = solution
 /method = ml
 /fixed = time1 program time1*program
 /random intercept time1 | subject(id) covtype(un).


Figure 3.5, page 71

mixed cog with time1 program 
 /method = ml
 /fixed = time1 program time1*program
 /random intercept time1 | subject(id) covtype(un)
/save = fixpred(pred).
GRAPH
  /SCATTERPLOT(BIVAR)=age WITH pred BY program.


How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California