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.
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.