# 15.3.8.5 Algorithm (Comparing Two Datasets)

Origin uses the F-Test to find the best model for one dataset.

## F-Test

Suppose the residual sum of square and degree of freedom for the two fit result is $RSS_1, RSS_2, df_1, df_2$, we have:

$SSR_{separate}=RSS_1+RSS_2 \,\!$

$df_{separate}=df_1+df_2 \,\!$

We can combine the two data sets (appending one to the other), and then perform a fit on the combined data set with the same function and calculate the residual sum of square and degrees of freedom, which are denoted as $SSR_{combined}$ and $df_{combined}$. Then we can compute the F value by:

$F=\frac{(SSR_{combined}-SSR_{separate})\;/\;(df_{combined}-df_{separate})}{SSR_{separate}\;/\;df_{separate}} \,\!$

Once the F value is computed, Origin calculates a p-value by:

$p=1 - fcdf(F,df_{combine}-df_{seperate},df_{seperate}) \,\!$

This p-value is then used to make a statistical statement as to whether or not the data (not the parameter values) are significantly different. If the p-value is greater than 0.05, we can say that the datasets are not significantly different at the 95% confidence level.