The code does not account for missing values when it assigns the size of the vectors for performing multiple linear regression. This results in extra values (set at who knows what) being included in the regression test.
The calculation for R^2 and p-value are just not right. The degrees of freedom are wrong for the F-test as well as the code for calculating the F statistic value.
I have a fix and will be pushing it for a PR here shortly.
Here's the problems:
I have a fix and will be pushing it for a PR here shortly.