UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SPSS Textbook Examples
Computer-Aided Multivariate Analysis, Afifi and Clark
Chapter 7

Page 125 Regression from chapter 6

get file 'c:\cama3\lung.sav'.

compute ffev1a = ffev1/100.
execute.

regression
 /dependent ffev1a
 /method = enter fheight.

Page 127 Descriptive statistics at the bottom of the page

descriptives variables = fage fheight ffev1a.

Page 133 Covariance and correlation matrices

Covariance:

NOTE:  Although the table below is labeled "Correlations" and is not in the same order as shown in the text, it is the correct table with the correct covariances.

regression
 /dependent ffev1a
 /method = enter fage fheight fweight
 /descriptives cov.

Correlation:

correlation 
 /variables fage fheight fweight ffev1a.

Page 138 Table 7.2  ANOVA example from the lung function data (fathers)

regression
 /dependent ffev1a
 /method = enter fheight fage.
<some output omitted>

Page 140 The t-test at the top of the page

NOTE:  This is given in the output from the above regression.

Page 150 Table 7.5  Statistical output for the lung function data for males and females

NOTE:  To do the top part of the table, you need to reshape the data from wide to long.  In SPSS, the command to do this is varstocases.  Also, the statistic called "S" in the text is labeled as "Std. Error of the Estimate" in the SPSS output.

varstocases
 /id = id1
 /make age from fage mage
 /make height from fheight mheight
 /make fev1 from ffev1 mfev1
 /index = Index1(2)
 /keep =  fage mage fheight mheight ffev1 mfev1.

compute fev1a = fev1/100.
execute.

regression 
 /dependent fev1a
 /method = enter age height
 /descriptives mean stddev.
<some output omitted>

The second and third panels of the table.

NOTE:  We use the value labels command to label the newly created variable gender for clarity in the output.  We use the split file command to split the data file by gender to get the analyses for each gender.  The temporary command is used so that the split file command does not permanently split the file; rather, the file is split only while the next command (in this case, the regression command) is executed.  We need to sort the data on the variable on which we will split the file, and we use the sort cases command to do this.

value labels gender 1 "male" 2 "female".

sort cases by gender.
temporary.
split file by gender.

regression
 /dependent fev1a
 /method = enter age height
 /descriptives mean stddev.


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