Fix missing @clicksequence problem with older Texinfo versions.
[pspp-builds.git] / doc / regression.texi
1 @node REGRESSION
2 @comment  node-name,  next,  previous,  up
3 @section REGRESSION
4
5 @cindex regression
6 @cindex linear regression
7 The REGRESSION procedure fits linear models to data via least-squares
8 estimation. The procedure is appropriate for data which satisfy those
9 assumptions typical in linear regression:
10
11 @itemize @bullet
12 @item The data set contains @math{n} observations of a dependent variable, say
13 @math{Y_1,@dots{},Y_n}, and @math{n} observations of one or more explanatory
14 variables. Let @math{X_{11}, X_{12}}, @dots{}, @math{X_{1n}} denote the @math{n} observations of the
15 first explanatory variable; @math{X_{21}},@dots{},@math{X_{2n}} denote the @math{n} observations of the
16 second explanatory variable; @math{X_{k1}},@dots{},@math{X_{kn}} denote the @math{n} observations of the kth
17 explanatory variable.
18
19 @item The dependent variable @math{Y} has the following relationship to the 
20 explanatory variables:
21 @math{Y_i = b_0 + b_1 X_{1i} + ... + b_k X_{ki} + Z_i} 
22 where @math{b_0, b_1, @dots{}, b_k} are unknown
23 coefficients, and @math{Z_1,@dots{},Z_n} are independent, normally
24 distributed ``noise'' terms with mean zero and common variance. The noise, or
25 ``error'' terms are unobserved. This relationship is called the
26 ``linear model.''
27 @end itemize
28
29 The REGRESSION procedure estimates the coefficients
30 @math{b_0,@dots{},b_k} and produces output relevant to inferences for the
31 linear model. 
32
33 @c If you add any new commands, then don't forget to remove the entry in 
34 @c not-implemented.texi
35
36 @menu
37 * Syntax::                      Syntax definition.
38 * Examples::                    Using the REGRESSION procedure.
39 @end menu
40
41 @node Syntax
42 @subsection Syntax
43
44 @vindex REGRESSION
45 @display
46 REGRESSION
47         /VARIABLES=var_list
48         /DEPENDENT=var_list
49         /STATISTICS=@{ALL, DEFAULTS, R, COEFF, ANOVA, BCOV@}
50         /SAVE=@{PRED, RESID@}
51 @end display
52
53 The @cmd{REGRESSION} procedure reads the active file and outputs
54 statistics relevant to the linear model specified by the user.
55
56 The VARIABLES subcommand, which is required, specifies the list of
57 variables to be analyzed.  Keyword VARIABLES is required. The
58 DEPENDENT subcommand specifies the dependent variable of the linear
59 model. The DEPENDENT subcommand is required. All variables listed in
60 the VARIABLES subcommand, but not listed in the DEPENDENT subcommand,
61 are treated as explanatory variables in the linear model.
62
63 All other subcommands are optional:
64
65 The STATISTICS subcommand specifies the statistics to be displayed:
66
67 @table @code
68 @item ALL
69 All of the statistics below.
70 @item R
71 The ratio of the sums of squares due to the model to the total sums of
72 squares for the dependent variable.
73 @item COEFF
74 A table containing the estimated model coefficients and their standard errors.
75 @item ANOVA
76 Analysis of variance table for the model.
77 @item BCOV
78 The covariance matrix for the estimated model coefficients.
79 @end table
80
81 The SAVE subcommand causes PSPP to save the residuals or predicted
82 values from the fitted
83 model to the active file. PSPP will store the residuals in a variable
84 called RES1 if no such variable exists, RES2 if RES1 already exists,
85 RES3 if RES1 and RES2 already exist, etc. It will choose the name of
86 the variable for the predicted values similarly, but with PRED as a
87 prefix.
88
89 @node Examples
90 @subsection Examples
91 The following PSPP syntax will generate the default output and save the
92 predicted values and residuals to the active file.
93
94 @example
95 title 'Demonstrate REGRESSION procedure'.
96 data list / v0 1-2 (A) v1 v2 3-22 (10).
97 begin data.
98 b  7.735648 -23.97588
99 b  6.142625 -19.63854
100 a  7.651430 -25.26557
101 c  6.125125 -16.57090
102 a  8.245789 -25.80001
103 c  6.031540 -17.56743
104 a  9.832291 -28.35977
105 c  5.343832 -16.79548
106 a  8.838262 -29.25689
107 b  6.200189 -18.58219
108 end data.
109 list.
110 regression /variables=v0 v1 v2 /statistics defaults /dependent=v2 
111            /save pred resid /method=enter.
112 @end example