Content: This page contains an applet on linear regression and instructions for its use. With this applet univariate and multivariate linear regression models can be handled. A number of predefined data sets are available. Alternatively, the data can be entered manually.

 

  Applet

Download Applet

  Theory

Analysis for Computer Scientists, Chapter 1

  Description of the data sets


The predefined data sets and their sources are described under the links below.

 

  Help


The data

As a first step, the data on which a linear regression is to be performed must be entered. To that end either an example from the combo box Load example in the tab Data examples can be loaded or the data can be entered manually. To enter the data manually choose the tab Enter data and fill the fields Number of variables and Number of data sets. By pressing Generate an empty matrix in which the data can be entered is generated. 

 

Linear regression

 

Perform regression analysis

To perform the regression analysis, enter the variable that is to be explained by the data into the field Dependent variable (the variables can be accessed by using "x1,..., xn"). The shape functions have to be entered in the field Regressor variables (separated by commas). In the screenshot a data set with three variables is given and the first variable x1 is to be explained by a linear combination of the variables x2, x3, i.e., the model is given by

                       x1 = b0 + b1 x2 + b2 x3. (1)

One has to enter "x1" into the field Dependent variable and "x2, x3" into the field Regressor variables. Note that it is possible to consider more complicated models, such as

x1 = b0+ b1 x2 x3 + b2 cos(x2) + b3 x22. (2)

In this case one should enter "x2*x3, cos(x2), x2^2" into the field Regressor variables.  Note that the constant function 1 is always included in the set of shape functions, i.e., b0 is always included in the model. To perform the regression, one has to press the button Apply regression.

Output of the result

If the regression succeeds (in case the data matrix does not have full rank an appropriate message is displayed) the tab Output shows all the relevant results. Apart from the usual results of interest, namely

  • Total variability (SYY),
  • Regression sum of squares (SSR,),
  • Error sum of squares (SSE,),
  • Coefficient of determination (R²),
  • Predicted regression function

the proportions of explanatory power of the individual variables are illustrated in a pie chart. The computation of the average explanatory power is expensive. The applet performs this analysis only if the regression function has at most seven variables.

 

Linear regression 2

 

Plot of the result

If the regression function depends on a single variable, the predictive function and the data points (independent variable, dependent variable) can be displayed using the tab Plot. Multiple shape functions in a single variable are admitted as in the example displayed in the first screenshot. Here, the model is 

x1 = b0 + b1 x2 + b2 sin(x2) + b3 x22 . (3)

Linear regression 3

 

Questions

If you have further questions or comments, or if you found a bug, please send us an e-mail.

 Financially supported by

University of Innsbruck: New Media and Learning Technologies
Austrian Federal Ministry of Education, Science and Research

Nach oben scrollen