Program description

Regression calculation


1. Introduction

1.1 Overview
1.2 Installation
1.3 Files
1.4 Integrated help and documentation
1.5 Operation within the forms
1.6 Operation within the Tables
1.7 Operation within the Graphic

2. Measured values

2.1 Measured values file
2.2 Measured values form
2.3 Measured values list output
2.4 Symbols

3. Outliers test

4. Regression calculation

4.1 Function and significance test
4.2 Confidence and tolerance interval
4.3 Value inquiry
4.4 Additional data regression curve
4.5 Characteristics of the measuring system
4.6 Log
4.7 Layout of the output

5. Outputs (report)

6. Problem solving and compatibility


See Document List

1. Introduction

1.1 Overview

With P&K 3950 we offer a PC program to carry out regression calculation according to VDI 3950 part 1 "Calibration of Automatic Emission Measuring Instruments" (1994-07) .

Here, regression for linear, square, logarithmic and exponential functions are possible.

An outliers test (according to Grubbs/guideline VDI 2449), independent of the regression calculation, is integrated in the program.

Parameters, like statistical certainty are variable and therefore calculations according to the guideline VDI 2066 (dust measurements) are possible.

Up to 200 data sets of measured values can be entered and commented on. A numeric ASCII table with two columns can be provided in the data path. This file must have the extension rgt . This file can be selected for opening under "File/Open".

As described in the guidelines, the square formula will be tested (if requested) if it is significantly better than the formula of the first degree.

The coefficients determined by the program can be replaced with other coefficients. Coefficients can be tested on a user defined basis , e.g. how numbers are rounded or a physical dependency. All characteristic values are derived from the users' coefficients. In addition, the function determined by the program can be displayed.

In a query block, characteristically values on the curves can be recalled, e.g. entering the X-value to receive the Y-values on all curves, or, any Y-value to receive all other values.

1.2 Installation

To install the program, execute setup program and choose the desired language (in the menu Options) after installation.

The program can be started by executing rgw.exe. For simplification a link to a user defined program group has been produced during the installation.

1.3 Files

The parameters and the measurement data of a project are stored in a set of files with the same name but with different extensions. The project consists of one data file and one parameter file.

The file menu makes functions available for all the necessary handling of files or projects:

New Creates a new project with the name NONAME in which data can be entered. It can be saved under a new project name. (File/ Save As).
Open A form will be opened which can be used for opening a project or an individual parameter or a data file. Data files and parameter files of different projects can be combined. This is especially helpful when using the same configuration with different sets of data (as template).
Save Saves all files associated with a project. Overwrites without prompting, except when no name is given.
Save As Saves all files associated with a project. The project name can be chosen or entered in a form. If one of the files already exists, the form will ask you if you want to overwrite.
Delete Deletes all files associated with a project. The project can be chosen in the form.
Copy Copies all files associated with a project. A source and destination project name can be chosen or entered in the form.

A set of files will be created by using the file menu. These files are administered in the current data directory with a different extension and the same name (the project name) :

*.RGW Project File (NEW)
*.RGT Data file (measured data)
*.RGP Parameter file

RGT and RGP files are simple ASCII format text files (no Multibyte Characters). Their structures are described in the following paragraph.

The files can be opened independently, thus a RGP file can easily become a template for other measurements, or ASCII files with the extension RGT can be imported.

1.4 Integrated help and documentation

In P&K 3950, a context-sensitive help is integrated. It can be pulled up at any location in the form by pressing the function key "F1". In the help screen, if necessary, highlighted cross references (links) are interspersed, which, by clicking on them, provide more detailed information.

For an easy startup, one or more sample files are supplied with the program in the program folder. The program is designed to initially show the folders Sample(s) and/or Beispiel(e). This feature does not work on all windows versions, in such a case one has to navigate to the program folder (e.g. c:\Program Files\P&K\....).

1.5 Operation within the forms

In den Bildschirmformularen erfolgen die Eingaben in Formularfeldern. Mit den Tasten Cursor rauf, Cursor runter, Tab und Shift Tab oder mit der Maus kann der Cursor über die Felder bewegt werden. Cursor links und Cursor rechts bewegen den Cursor zeichenweise innerhalb eines Feldes.

Reelle Zahlen können mit Punkt oder Komma oder auch als 1e-6 für 10-6 eingegeben werden. Der Fehlerton kann bei der Eingabe ignoriert werden, er wird nur als Warnung ausgelöst, weil 1e oder 1e- keine gültige Zahl ist.

Gegebenenfalls (wenn im Formular gekennzeichnet) kann eine Auswahlliste von diskreten Eingabewerten geöffnet werden.

Mit F1 wird zu einem Formularfeld oder zum ganzen Formular eine kontextbezogene Hilfe angeboten und das integrierte Handbuch zugreifbar.

Mit OK oder ABBRECHEN wird das aktuelle Formular verlassen.

Siehe auch: Calculator

Available (non-standard) forms:

1.6 Operation within the tables

The order and the width of all columns can be changed by clicking into a column header or between column headers and dragging as desired. This is practical if values are in a particular order, because Tab has to be pressed just once in order to reach the next column.

If the data in the columns are too wide to be displayed, then the symbols (in brackets) will be hidden in the column titles (e.g. Temperature (T0) ). Widening of the column will show that particular symbol.

The buttons "+" and "-" are used to insert or delete data sets. With the button "Dup" the current data set can be duplicated. The new row will become the last row in the table. This is useful if a data set is to be generated with minor difference to the current one. To insert a row, select the lower gray row before pressing the "+" button.

Individual fields, in which a selection is possible, are marked yellow. To activate the selection click once in a cell in order to select this; click a second time in order to activate the selection (no doubleclick).

With the cursor or Tab key, the focus can be moved between individual fields.

The illustrated section can be scrolled one row up or down by moving the cursor across the upper or lower edge of the table form.

Some tables can be sorted. With a right mouse button click into the considerable column, a Pull-Down Menu will be opened, and Sort Ascending or Sort Descending can be selected.

In some tables, a Row-Editor can be invoked. The Row-Editor shows one dataset only and can have more or less features then the grid dialog.

Sometimes single Columns can be imported via the Popup Menu. From the selected file, the values are taken and written to the position, from which the dialog was invoked. One value will be read per line from an ASCII file (includes CSV format) .

Some tables feature a search function. See Find in table

See: Calculator and Alter Column Values.


This feature allows to filter out a column with its value. Only rows with this value in the filtered column and not this column will be shown. The filter can be set to most of the columns (except when they are declared unique). All available column names are shown in the selector next to "Filter:". Once a column is selected, a corresponding value out of this column can be selected in the selector to the right of the equal sign. Filtering is accomplished on a text basis rather than on a value basis (e.g. 1.0 doesn't equal 1).

Using the filter feature will reorder the rows. Only columns, which are not defined as unique, can be selected. Some table can be sorted (Right Mouse Button Click into the column of regard.)

A filter might be active during import / export to exclude or include rows of data.

Table Import and Export

In most tables, data can be imported or exported with the buttons in the tool bar. The sequence of the columns and which columns are used, depends on the current column order and the current filter setting. With a button in the tool bar, a form can be opened which gives information about the current settings.

Single Columns can be imported via the Popup Menu. From the selected file, the values are taken and written to the position, from which the dialog was invoked. One value will be read per line from an ASCII file (includes CSV format) .

Available formats for import and export

CSVColumns are separate by commas (Comma Separated Values). If a text contains commas, it must be written in " " (Quotation marks). The decimal character is the point. Values can optionally contain an exponent (e.g.: 6.E-9), however no additional separators are allowed.
TXTColumns are separated by spaces. If a text contains spaces, it must be written in ' ' (Apostrophe). The decimal character is the point. Values can optionally contain an exponent (e.g.: 6.E-9), however no additional separators are allowed.
Current Project ExtensionIndividual tables can be loaded from project files. The loaded table must fit logically into the project.
The export creates a new project file, which contains only the exported table.
*On selection of the file type [With Options (*.*)], the form Table Import Options will be opened, in which further parameters are available.

The formats can be selected in the appropriate dialogs under the type of file. The filter function is switched off for other formats than CSV, TXT and *!


The tables can be viewed appealingly as an HTML-file by using the preview function. see Report function.

1.7 Operation within the graphics

Some dialogs can also be opened by clicking onto the axis, the legend, the title, the series or by double clicking the drawing area.


Most of the illustrations can be zoomed; therefore a rectangle has to be opened with the mouse from the upper left corner to the lower right corner. To reset the zoom, a rectangle from the lower right corner to the upper left corner has to be opened with the mouse.


The graphic can be moved; therefore the graphic is to be dragged with the right mouse button down.

Clipboard and Export Formats

In the menu Edit, the graphic can be copied to the clipboard. The graphic is then available to be pasted into other windows programs. The graphic can be copied in different formats:

  • In the Bitmap format, every pixel of the image is copied. This can be pasted in almost every program, but when scaling it, the results may be unsatisfactory.
  • In Meta file format, lines are stored as vectors and are therefore scalable.

The graphic format can be set in Layout/Setup Chart/Export.


Alterations made in Layout/Setup will not be saved automatically. In some illustrations it might be possible to save and load configuration changes under the layout menu, but it might cause strange effects, because the configuration might not fit to the current illustration. Series, which are not needed in the current illustration and which are not automatically destroyed can be made inactive. Data are managed in so called Series. The configuration can be saved with or without data. The data are normally replaced with the current ones, despite this, sometimes it might still be important to save the data along with the configuration.

Modifications and settings in other forms or of the calculated data can overwrite made changes in Layout/Setup!

2. Measured values

2.1 Measured values file

A maximum of 200 data set of measured values are stored in a ASCII file. They can be modified or entered within the program. This file can be easily generated outside the program.

The file has the extension RGT and has the following line by line structure:

  • C1-value (X-, Y-value or calculation value)
  • C2-value (X-, Y-value or calculation value)
  • Index for the symbol: 6 or 0 for the indicator for "deactivated" and 1-5 in the order shown in Symbols:
  • C3-value (X-, Y-value or calculation value)
  • T (temperature)
  • P (pressure)
  • F (dampness)
  • O2-value
  • Ps (static pressure at measuring location)
  • B (defining text)
  • D (date)
  • t1 (start time)
  • t2 (end time)
  • dt (duration)
  • C4, C5, C6 and C7 (X-, Y-value or calculation value)

The measured values are unformatted. They must be separated with spaces. A dot should be used as a decimal character, e.g. .99 0.99 9.9E-1. B, D, t1 and t2 are strings, they must be quoted in ' when empty or, when containing spaces.

The table must consist of a minimum of two columns. For that the symbol " x " (index = 1) is assumed. The combination C1, C2, S, {B}or C1, C2, C3, T, P, F, {B} can be also read from the program. In any case, the total structure will be written back into the file.

2.2 Measured values form

The form Measured values/Edit is available for entering and handling measured values.

In the upper part of the form, the project title and axis information are to be entered (see below). These will appear in the diagram and in the list output.

See the forms Measured values and Column settings

2.3 Measured values list output

The measured values can be listed under the menu option "measured values/list" or "Report". The measured value list can be printed, but is meant to be used in customer created documentation only. To do so, the contents of the list must be copied via the clipboard into the target document.

2.4 Symbols

In the form "measured value/symbols" the pre-defined symmetrical symbols can be associated with a description and a color. These symbols are to categorize the measured values, whereby the symbol "o" serves for the representation of deactivated values. Deactivated values are ignored in the calculation. If descriptors are defined, and this symbol is associated to a data set, then the symbol will be used to mark the point in the graph. Descriptor and symbol will be added to the legend. The descriptor will also appear next to the measured values in the list output or report.

See: Text and colors of the symbols form

3. Outliers test

For individual measured values, an outliers test can be carried out with a two-sided level of significance of 95%, according to Grubbs, as documented in the guideline VDI 2449 part 1.

A test value is calculated and compared with a critical table value. If the test value (PG) exceeds the critical table value, the measured value maybe eliminated only if an experimental reason for the outlier can be found. The test can be repeated with a reduced data collective, however, a maximum of up to two pairs may be eliminated in the boundary region and a maximum of one within the middle region. The data set can be eliminated by deactivation.

The test is independent of the regression calculation. It supplies a log text, which can be copied into any document via the clipboard.

If the outlier test is used in the form "measured values/Edit", and if a possible outlier is found, this data set will be the current one.

See: Measured values form

4. Regression calculation

Under the menu "regression", there are forms with functions:

  • for the determination of the analysis' coefficients
  • for the calculation of the characteristics
  • for the configuration of the graphic and text documentation

The calculations are based on the specifications in the guideline VDI 3950 part 1 of July 1994. In addition following sources were used:

  • HARTUNG, Statistik, Oldenbourg 1985
  • HERRMANN, Satistik in C, Vieweg 1991
  • VDI-guidelines, as mentioned in the text

4.1 Function and Significance test

The function is selected from a list. The coefficients are determined in accordance with conditions of the smallest deviation squares.

With selection of the function f(x) or the button "Auto f(x)" a significance checking between the polynom formulation of the first (linear regression) and the second order (quadratic regression) is performed and the quadratic formulation is selected., if it is significantly (with a confidence of 95%) better than the linear formula.

Criterion for the quality in that connection are the scatters, which are calculated according to the equations 5 (linear regression) and 27 (quadratic regression) of the guideline VDI 3950. The significance criterion at a confidence of 95 % provides the test value F from the table B4 of the guideline.

Also the program supports logarithmic and exponential regressions in linear and quadratic form, but with some limitations.

For user information several statistical characteristic quantities are shown in the Regression form and in the regression log.

See: Regression form

4.2 Confidence and tolerance interval

The confidence interval is the area in which a measured value with a given statistical certainty "s" will be found. For a statistical confidence of 95% the
guideline VDI 3950 indicates a computation method. For other values of certainty the algorithms from HARTUNG, page 892 were used.

The tolerance interval is the area in which future measurements are prognosticated correctly to a given share (1-Gamma). For a share of 95% the
guideline VDI 3950 indicates a computation method. For other values of the share, the algorithms from HARTUNG, page 164 were used.

See: Regression form

4.3 Value inquiry

By entering of one of the values from the following list:

  • X-value
  • Y-value (function value)
  • Yv+ , Yv- (confidence interval)
  • Yt+, Yt- (range of tolerance)

the remaining values in the list are calculated.

See: Regression form

4.4 Additional data regression curve

Function, as well as confidence and tolerance interval, refer to user-defined coefficients when they are set. With a checkbox the additional representation of the data regression function is possible.

Both functions are then of the same type.

See: Regression form

4.5 Characteristics of the measuring system

In a separate form "regression/characteristics", up to six characteristic values of the measuring system can be defined to one limit value, which will be documented in the graphic and in the log.

This feature complies with the demands of 17. BimSchV.

See: Characteristics form

4.6 Log

The log shows the documentation and explanations of the current calculation, as well as the output of a list with the columns:

  • X-value
  • Y-value
  • Y-value + - confidence interval
  • Y-value + - tolerance interval
  • n'

in equidistant steps, which are defined in the form "regression/parameter" .

4.7 Layout of the output

The section of the representing curve range can be determined for the X-axis as well as for the Y-axis. If the entry at "to" is not higher than at "from" the scale will be chosen automatically.

The characteristic list in the log of the regression calculation extends using the same steps over the determined range. (If "Increment" is entered, then "Number of steps" will be calculated and vise versa.)

The validity of the regression calculation extends over the scope of the input data. Deviating from this, the curves can be extended by extrapolation (for illustration) beyond this area.

In addition to the primary X-scale a secondary X-scale can be defined (e.g. the extinction in the dust concentration measurement according to VDI 2066).

Therefore, a range of the second X-scale is mapped to the range ("from", "to") of the primary X-scale. This additional X-scale must be provided for activation with unit and name.

The graphic can be covered with a grid for better readability.

See: Result output form

5. Outputs (report)

The graphics, lists and logs can be printed using the windows system and the devices connected to it, or copied to the preferred program via the clipboard. For the graphic, a bitmap or a meta file can be copied. With bitmap every pixel of the image is copied. When scaling it, the results may be unsatisfactory. In meta files, however, lines are stored as vectors and therefore scalable.

The graphics can also be exported in different file formats at Edit / Export.

The reports are produced in HTML-format and left in the data directory. The report files then have the name of the project with the extension HTML and GIF. Of course, these documents can be modified with almost every text processing program, though you should be aware that this documents can be overwritten by the program easily by mistake. The structure of the report can be modified in the form options/settings.

Sample reports

In case the HTML-Layout needs to be modified, so called stylesheets can be used. The entry <STYLE>td {font-size:9pt;}</STYLE>, in the Standard settings form, tells the browser to display the content of table cells in 9 point font size. It it important to consider, that not all StyleSheet definitions are supported by all browsers.

Other used HTML-Elements are:

th table header cells
td data cells
h2 project heading
h3 sub headings
h4 table footer
p paragraph

A sample of a very compact formatting in the Standard settings form:

p,td,th  { font-size:6pt; line-height:7pt; font-family:Verdana; }
h2  { font-size:9pt; line-height:10pt; font-family:Verdana; }
h3  { font-size:7pt; line-height:8pt; font-family:Verdana; }
h4  { font-size:7pt; line-height:8pt; font-family:Verdana; margin-top:0; }
table {border:2px solid red; border-spacing:0px;border-collapse:collapse; margin-bottom:0; }

The illustration of the tables can be controlled with e.g. the entry Table.Properties=CELLSPACING=1 CELLPADDING=2 WIDTH="640" in p&k.ini. These settings determine the width of the table to 640 pixel, cells are padded with 2 pixels and between cells there is a space of 1 pixel. The setting Table.Properties=CELLSPACING=0 CELLPADDING=0 generates the most compact illustration.

There are two values in p&k.ini to control the size of the graphic in the Report. E.g. GraphicWidth.text=600 GraphicHeight.text=400 (on two lines) sets the graphic size to 600 x 400 pixels, which can be converted with approx. 96dpi. These Parameters are controlled in the Standard settings form. The Application window will be sized to these values on Report execution.

6. Problem solving and compatibility

with former versions
The program can read data from former versions, but creates a format which is unreadable for older programs.

Red line in the graphic legend
Too many elements have been chosen. They can't be illustrated in the measurements. In order to indicate that the legend is incomplete, it has been marked with a red diagonal line.
To correct, select less elements or extend the graphic window.

If the hints disappear too fast, a value for "HintHidePause" can be set in the file P&K.ini (in the program directory). E.g. "HintHidePause=2500" means, the hint remains visible for 2.5 sec., if no other actions with the mouse were made.

Axis label format

When not satisfied with the axes label format, one can insert a format definition in the file p&k.ini, which can be found in the program directory. The line "AxisValuesFormat=0.######" means, the decimal dot is to be shown, the leading zero is to be shown and a maximum of 6 digits of the fraction. The line "AxisValuesFormat=#,###.###" will show the comma when the value exceeds 1000, no leading zeros, a decimal dot and a maximum of 3 digits of the fraction. The quotation marks are not to be inserted.

Photography and More

Width :


      Accept Cookies