From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

R-squared for line fit

Hello,

I looking for function that calculating R-Squared for linFit.

I calculated the function y=Slope*x + Inter. using LiFit function. I want to find how well the Line is Best Fit actually fits the data.

 

 

Best

Regards Boris

Best Regards
Boris
0 Kudos
Message 1 of 2
(4,229 Views)

If you use the function LinearFitEx instead, with fit method least square, the function also returns the weighted mean square error.

 

Alternatively you can use GoodnessOfFit, which not only calculates the weighted mean square error but also the coefficient of determination, R2. Note that there are several different definitions of R2, see here.

0 Kudos
Message 2 of 2
(4,219 Views)