2.6 Compare Linear Fit Parameters/DatasetsCompareLinearFitParametersDatasets
This app, Compare Linear Fit Parameters/Datasets is used to compare linear fit parameters for multiple datasets, i.e. slope and intercept, and determine whether they are different. The logic of parameter comparison in this tool is: if one wants to compare intercepts, slopes are compared first. If slopes are found different according to the criteria, intercept comparison will not be done. In other words, the precondition of intercept comparison is that slopes are considered to be same for all datasets. This app can also be used to compare datasets using a linear model.
Examples
 Install the app if you haven't, an icon "Compare Linear Fit Parameters and Datasets" will show in Apps panel.
 Import Linear Fit.dat in \Samples\Curve Fitting folder to a prepared worksheet.
 Highlight Col(A) to Col(C) in that worksheet, click the icon "Compare Linear Fit Parameters and Datasets" from the Apps panel to bring up the fitlrcmpara XFunction dialog. Select Parameters for Compare, check Akaike Information Criteria(AIC), Ftest and General Linear Model for Method, make sure the Intercept checkbox is checked. The complete setting can be seen from the graph below:
 Click OK, the report should look like:
It can be seen that for this example, both slope and intercept are same in both methods.
Dialog Settings
Input Data
Specify datasets for linear fit comparison of parameters/datasets.
Fit Control
Fix Intercept

Specify whether to fix the intercept in linear fit. If intercept is fixed, Intercept in Parameters to Compare branch will be hidden.

Fix Intercept At

Specify the value of the fixed intercept.

Fix Slope

Specify whether to fix the slope in linear fit. If slope is fixed, Slope in Parameters to Compare branch will be hidden.

Fix Slope At

Specify the value of the fixed slope.

Settings
Compare

Specify what to compare.
 Datasets
 Compare datasets using a linear model
 Parameters
 Compare linear fit parameters

Method

Specify the comparison algorithm.
 Akaike Information Criteria(AIC)
 Comparison conclusion is made according to Akaike's weight.
 Ftest
 Comparison conclusion is made according to Pvalue.
 General Linear Model
 Option will show for Compare Parameters if there are 2 datasets. It compare slope or both slope and intercept.

Compare Pairwise

Option Compare Pairwise will show if there are more than 2 datasets. If checked, and the result between datasets is different, then pairwise comparison will be analyzed and output the Pairwise Comparison table:

Parameters to Compare
This branch is only available when Parameters is selected for Compare in Settings branch.
Slope

Specify whether to compare slope.

Intercept

Specify whether to compare intercept. If this is checked and Fix Slope is not checked, Slope will be checked and disabled.

Additional Outputs
Specify whether to output fitting tables.
Fit Parameters

Decide whether to output Fit Parameters table for each dataset.

Fit Statistics

Decide whether to output Fit Statistics table for each dataset.

Results
Specify the output report worksheet for the comparison result.
Algorithm
When comparing one specific parameter (or datasets), we are actually comparing two models. For one model, the parameter values can vary among different datasets, this is the more complicated model. For the other, the parameter values are assumed to be same for all datasets, this is the simpler model. When comparing slopes, the more complicated model corresponds to independent fit for each dataset and the simpler model corresponds to global fit with slope shared. When comparing intercepts, the situation is a little different. As stated at the beginning of this document, we compare intercepts only when we have compared slopes and concluded that they are same. So the more complicated model for comparing intercept corresponds to the simpler model for comparing slope. The simpler model for comparing intercept corresponds to a line function with all parameters shared in all datasets, i.e. concatenate fit.
When comparing datasets using a linear fit model, the more complicated model corresponds to independent linear fit for each dataset while the simpler model corresponds to a line function with all parameters shared in all datasets.
Akaike Information Criteria(AIC)
For each model, Origin calculates the AIC value by:
where RSS is residual sum of squares for that model, N is the number of data points, K is the number of parameters.
For two fitting models, the one with the smaller AIC value is suggested to be a better model for the datasets, and then we can determine whether parameter values to be compared are same.
We can also make decisions based on the Akaike's weight value, which can be computed as:
Here i=1 represents the simpler model and i=2 represents the more complicated model. and are the AIC values of the two fitting models, respectively.
If is larger than , we can conclude that parameter values to be compared are same, otherwise parameter values are different.
Ftest
Suppose the sum of RSS and the sum of df (degrees of freedom) of the simpler model fit are and those of the more complicated model fit are .
We can compute the F value by:
Once the F value is computed, Origin calculates the Pvalue by:
This Pvalue can be used to determine whether parameter values to be compared are different. If the Pvalue is greater than 0.05, we can conclude that parameter values to be compared are not significantly different.
General Linear Model test
The General Linear Model method fits a general linear model to the concatenated dataset and checks the fitted parameters to determine the significance of the differences in slopes and intercepts. The method concatenates the two groups of xy datasets () and includes a categorical variable () that identifies each group.
A general linear model with the interaction term is fitted to the dataset:
The significance of the slope difference is determined by the Ttest of the term in the model.
If the slope difference is not significant, the test of the difference in intercepts can be performed. A general linear regression model without the interaction term xc*xf is fitted to the dataset:
The significance of the intercept difference is determined by the Ttest of in the model.
