1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
* (Q) My data contains various groups. I want to do a linear regression separately for each group then
* compare the resulting coefficients.
* (A) by Raynald Levesque 2004/12/17 www.spsstools.net .

GET FILE='c:\\program files\\spss\\employee data.sav'.
SORT CASES BY jobcat.
SPLIT FILE BY jobcat.
REGRESSION
  /MISSING LISTWISE
  /STATISTICS COEFF OUTS R ANOVA
  /CRITERIA=PIN(.05) POUT(.10)
  /NOORIGIN
  /DEPENDENT salary
  /METHOD=ENTER educ jobtime
  /OUTFILE=COVB('C:\\temp\\coef.sav') .
SPLIT FILE OFF.

GET FILE='C:\\temp\\coef.sav'.
SELECT IF rowtype_ = "EST".
EXECUTE.