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 4: Doing Data Analysis with the Multilevel Model for Change


Figure 4.1, page 77

To make the graph look like the manuscript, you need to do the following additional steps via "point and click". 

To remove the regression equation from each of the plot, double click on the graph and click on the chart manager icon.  Then click on the Regression item and click on Edit and then click Options and then uncheck Show Mean Line Label and uncheck Show R-Squared Label.

get file ="c:\alda\alcohol1_pp.sav".

* figure 4.1.
compute filt=0.
if any(id,4,14,23,32,41,56,65,82) filt=1.
execute.
filter by filt.
IGRAPH 
/VIEWNAME='Scatterplot' 
/X1 = VAR(age_14) TYPE = SCALE 
/Y = VAR(alcuse) TYPE = SCALE 
/PANEL =  VAR(id) 
/FITLINE METHOD = REGRESSION LINEAR LINE = TOTAL MEFFECT
 /CATORDER VAR(id) (ASCENDING VALUES OMITEMPTY) 
/SCATTER COINCIDENT = NONE.
filter off.


Figure 4.2, upper panel, page 79

To make the graph look like the manuscript, you need to do the following additional steps via "point and click". 

To remove the regression equations, double click on the graph and click on the chart manager icon.  Then click on the Regression item and click on Edit and then click Options and then uncheck Show Mean Line Label and uncheck Show R-Squared Label.

We omitted the legend at the right by click on the legend and choosing hide legend

Note that this shows the graphs for all of the subjects, not just a sample, so the results are somewhat different from the text.

value labels coa 0 "Not COA" 1 "COA".
igraph
  /x1=var(age) type=scale
  /y=var(alcuse) type=scale
  /style= var(id)
  /panel=var(coa)
  /fitline method=regression linear line=total meffect spike=off
  /scalerange=var(alcuse) min=-1 max=4.

Figure 4.2, lower panel, page 79

We made the same kinds of modifications to the lower panel as we did to the upper panel to make the graphs look like those in the book.

compute hipeer=0.
if (peer > 1.0175595) hipeer=1.
value labels hipeer 0 "Low Peer" 1 "High Peer".

* Top panel of Figure 4.2.
igraph
  /x1=var(age) type=scale
  /y=var(alcuse) type=scale
  /style= var(id)
  /panel=var(hipeer)
  /fitline method=regression linear line=total meffect spike=off
  /scalerange=var(alcuse) min=-1 max=4.


Table 4.1, pages 94-95
title "Model A".
mixed alcuse 
  /print=solution
  /method=ml
  /fixed=intercept
  /random intercept | subject(id).

title "Model B".
mixed alcuse with age_14
  /print=solution
  /method=ml
  /fixed = age_14
  /random intercept age_14 | subject(id) covtype(un).

title "Model C".
mixed alcuse with coa age_14
  /print=solution
  /method=ml
  /fixed = coa age_14 coa*age_14
  /random intercept age_14 | subject(id) covtype(un).

title "Model D".
mixed alcuse with coa peer age_14
  /print=solution
  /method=ml
  /fixed = coa peer age_14 coa*age_14 peer*age_14 
  /random intercept age_14 | subject(id) covtype(un).

title "Model E".
mixed alcuse with coa peer age_14
  /print=solution
  /method=ml
  /fixed = coa peer age_14 peer*age_14 
  /random intercept age_14 | subject(id) covtype(un).

title "Model F".
mixed alcuse with coa cpeer age_14
  /print=solution
  /method=ml
  /fixed = coa cpeer age_14 cpeer*age_14 
  /random intercept age_14 | subject(id) covtype(un).

title "Model G".
mixed alcuse with ccoa cpeer age_14
  /print=solution
  /method=ml
  /fixed = ccoa cpeer age_14 cpeer*age_14 
  /random intercept age_14 | subject(id) covtype(un).

Model A


Model B


Model C


Model D


Model E


Model F


Model G


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