The downside to this method is that there is not a reported R2 value for the fit. However, some literature says that the R2 value is the same for the RMA fit as it is for the least squares fit method. So, if you create a line/scatter plot and add the Linear fit, the statistics for the linear fit are the same as the statistics for the RMA fit. You can then run the script to add the RMA fit curve to the graph.
To run this script:
- Click here to download the BAS file: create RMA fit curve.BAS.
- Click Automation | Scripts | Run, select the BAS file from your downloads directory, and click Open.
- To get the R2 statistic, click on the line/scatter plot in the Object Manager.
- In the Property Manager, click on the Plot tab.
- Click the Add/Edit button next to the Fits command.
- In the Fits dialog, select Linear, Y=B*X+A.
- Click Add.
- Click OK.
- Click on the Fit 1: Linear fit curve in the Object Manager.
- In the Property Manager, click on the Display button next to the Report option. The statistics appear in a report window.
- Highlight the Coefficient of determination, R-sq'd value (R2) value in the report.
- Click Edit | Copy in the report window.
- In the main plot window, click Home | Clipboard | Paste. The value is pasted to the center of the plot window. You can click on the value and move it to the desired location or edit the text.
Updated January 11, 2018