Plotting a linear regression line + displaying equation of line, r-squared value, p-value on same subplot

5 views (last 30 days)
Hi everyone,
I have been searching around for these answers but it is not always clear:
I have about 6 scatter-subplots on each figure that I am producing. On each of these subplots, I wish to:
- plot a line of linear regression - display its equation - display the R-squared value of the fit - display the p-value statistic of a simple t-test
What is simply the best way to do these efficiently for many plots? I've tried using the 'basic fitting toolbox' for the best fit line and equation, but the line and equation disappears on the previous subplot once i move on to choosing the toolbox options for another subplot.
My sincere apologies if this is rather basic or if the answer is out there.. I will look out for more answers in the meantime. Thanks!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!