<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">On 24.08.2020, at 23:08, Rafael Guerra <<a href="mailto:jrafaelbguerra@hotmail.com" class="">jrafaelbguerra@hotmail.com</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">Hi Heinz,<br class=""> <br class="">For the regression errors, I am not an expert but from wikipedia or from reference below, I would risk the following code (at your peril):<br class=""><a href="https://pages.mtu.edu/~fmorriso/cm3215/UncertaintySlopeInterceptOfLeastSquaresFit.pdf" class="">https://pages.mtu.edu/~fmorriso/cm3215/UncertaintySlopeInterceptOfLeastSquaresFit.pdf</a><br class=""> <br class="">// Note: for degrees of freedom>=6, t-distribution ~2<br class="">N = length(MW);<br class="">mx = mean(MW);<br class="">SSxx = sum((MW -mx).^2);<br class="">Ea = diag(2*sig/sqrt(SSxx)) // take Ea diagonals; slope 95% confidence <br class="">Eb = diag(2*sig*sqrt(1/N+mx^2/SSxx)) // take Eb diagonals; intercept 95% confidence<br class=""> <br class="">Concerning the least squares regression part, it seems the code may be written more compactly using reglin:<br class=""> <br class="">[a,b,sig]=reglin(MW',Y') // simple least squares linear regression<br class="">GG= a.*.xx' + repmat(b,size(xx'))<br class="">plot(xx,GG','LineWidth',1);<br class=""></blockquote><div class=""><br class=""></div><div class=""><br class=""></div>Here is a little misunderstanding (my fault: I had not explained it).<br class="">I want all three straight lines to go simultaneously through one point at the negative x-axis. This is why I had to use a non-linear least-squares fit.<div class=""><br class=""></div><div class="">Heinz</div><div class=""><img apple-inline="yes" id="3FCC717E-FBBE-42AC-B0F7-2885F7149DAE" src="cid:3C3F68FE-F656-4654-838E-01E9286ED6B3@upc.at" class=""></div><div class=""><br class=""></div><div class=""><br class=""><br class=""></div></body></html>