Exporting Linear & Polynomial Regression from Polymath to Excel

See Also: Exporting from Polymath to Excel  Variables and Expressions 


The "Export to Excel"  capability in the Data Table is executed by clicking on the Excel icon found on the particular regression window.  You must have your Excel program active on your desktop before exporting a program to Excel.  A problem should be exported after it has been completely entered successfully into Polymath and ready for solution. It is also good practice to also solve the problem in Polymath so that the solution in Excel can be compared and verified.  Upon export, the problem in Polymath will be completely transferred into Excel.  This transfer automatically includes the translation of logical statements and the intrinsic functions from Polymath into equivalent functions within Excel. 

 

Linear & Polynomial Regression

Example 1: Fitting Polynomial of Degree 1 - Heat Capacity Data of Solid Hydrogen Bromide.

Consider the data set shown below that is from Example 3 - Heat capacity in the Polymath REG Regression Program. The data set may be obtained within the Polymath REG program by clicking on the Examples button and holding until Example 3 : Heat capacity is highlighted.  This should bring the data into the Polymath Data Table.

Select the Regression tab and the Linear & Polynomial tab at the right side of the Data Table. Select Dependent Variable: Cp, Independent Variable: T, Polynomial Degree: 1 Linear, and check only Report.  (This is also indicated on the above window and may automatically be displayed when accessing Example 3.)

Press the Excel icon   to have this problem exported and automatically solved within an Excel spreadsheet:

 

Note that this problem has been automatically transformed and solved within the open Excel spreadsheet on a new worksheet.  The results agree with the results obtained with Polymath for this same problem as shown below as discussed in more detail in Example 1 of Linear & Polynomial Regression.

 

Linear Regression 28-Sep-2004

Model: Cp = a0 + a1*T

Variable Value 95% confidence
a0 8.13858 0.402096
a1 0.0216109 0.0027439

General
Regression including a free parameter
Number of observations = 18

Statistics

R^2 0.9457227
R^2adj 0.9423303
Rmsd 0.0245012
Variance 0.0121562

 

Note that the intrinsic function LINEST is used in the Excel solution of this linear regression problem.

Example 2: Fitting Polynomial of Degree 2 (with Graph and Residuals) - Heat Capacity Data of Solid Hydrogen Bromide.

Consider the data set from Example 3 - "Heat capacity" in the Polymath REG Regression Program.   The data set may be obtained within the Polymath REG program by clicking on the Examples button and holding until Example 3 : Heat capacity is highlighted.  This should bring the data into the Polymath Data Table. For this example, please click on the Regression tab at the bottom of the Data Table and select Dependent Variable: Cp, Independent Variable: T, and Polynomial Degree: 2 .

Press the Excel icon   to have this problem exported and automatically solved within an Excel spreadsheet:

Note that this problem has been automatically transformed and solved within the open Excel spreadsheet on a new worksheet.  The results agree with the results obtained with Polymath for this same problem as shown below as discussed in more detail in Example 2 of Linear & Polynomial Regression for a 2nd degree polynomial.

POLYMATH Report Heat capacity of Hydrogen Bromide
Polynomial Regression 26-Oct-2004

Model: Cp = a0 + a1*T + a2*T^2

Variable Value 95% confidence
a0 14.43818 1.68923
a1 -0.0643514 0.0229501
a2 0.0002877 7.67E-05

General
Degree of polynomial = 2
Regression including a free parameter
Number of observations = 18

Statistics

R^2 0.9896808
R^2adj 0.9883049
Rmsd 0.0106832
Variance 0.0024652

The Polymath Graph can be produced within Excel by graphing both the "Cp calc" column as a line and the "Cp" column as a symbol on the Y axis versus the "T" column on the X axis.

Similarly the Polymath Regression Residual Plot can be produced within Excel: