Working with Regression Tokens and Fit Equations

We will now display a regression token on the Scatter with Regression Plot.

1.Right-click on the Scatter with Regression plot and select Add text box from the pop-up menu (Fig. T27.8, number1).
2.Right-click in the text box on the plot and select Insert Token from the pop-up menu (Fig. T27.8, number2).
3.Double-click Statistic in the Insert a Token dialog (Fig. T27.8, number3).
Figure 27.8  Adding a regression token to the plot

Figure 27.8  Adding a regression token to the plot

4.Click the Statistic category in the Create Statistic dialog (Fig. T27.9, number1).
5.Select Regression Parameter Statistics from the Select a Statistic dropdown menu (Fig. T27.9, number2).
6.Select m (slope) from the Statistic list (Fig. T27.9, number3).
7.Increase the Number of decimals to "4" (Fig. T27.9, number4).
8.Click OK (Fig. T27.9, number5).  The slope (m) of the regression curve is now displayed on the plot.
Figure 27.9.  Adding a regression token to the plot, continued

Figure 27.9.  Adding a regression token to the plot, continued

9.Click inside the text box to put it into edit mode.  The border will be green.
10. Use the arrow keys on the keyboard or click within the text box to move the cursor to the left of the token.
11. Type "m = " (Fig. T27.9, number6).  The token has now been annotated with this descriptive freetext within the text box. Note:  if necessary, the text box can be enlarged by dragging its border, so that all the text fits on one line as in the figure.

We will now create a Custom Token for the linear regression equation, so that we can apply the regression to other .fcs files (including those in other layouts).  Each token in the Regression Parameter Statistics list (Fig. 27.9 above) will be used as a component of this Custom Token.

12. Click the green plus (greenplus) in the Custom Tokens window (Fig. 27.10, number1).
Figure T27.10  Creating the Linear Regression Fit Custom Token

Figure T27.10  Creating the Linear Regression Fit Custom Token

13. Highlight the "New Custom Token" text in the Custom Tokens window (Fig. 27.10, number2).
14. Type 'LinFitLogMedMESF' (Fig. 27.10, number3).
15. Type "m=,b=,r2=" in the formula (lower) pane of the Custom Tokens window (Fig. 27.10, number4).
16. Click on the Scatter with Regression plot so its border becomes highlighted.
17. Drag and drop the border of the Scatter with Regression plot to the position after the "m=" and before the "," (comma) in the formula pane of the Custom Tokens window (Fig. 27.10, number5).
18. Double-click Statistic token from the Paste Special dialog (Fig. 27.11, number1).
Figure 27.11 Inserting a regression parameter token as a component of the linear regression fit custom token

Figure 27.11 Inserting a regression parameter token as a component of the linear regression fit custom token

19. Choose Regression Parameter Statistics from the Select a Statistic dropdown menu (Fig. 27.11, number2).
20. Choose m from the Statistic list (Fig. 27.11, number1).
21. Click OK.
22. Repeat Steps 17-21, with the following modifications:
Step 17:  Drop the plot after the "b=" in the formula pane of the Custom Tokens window
Step 20:  Choose b from the Statistic list
23. Repeat Steps 17-21, with the following modifications:
Step 17:  Drop the plot after the "r2=" in the formula pane of the Custom Tokens window
Step 20:  Choose r2 from the Statistic list
24. Drag the LinFitLogMedMESF Custom Token from the Custom Token window onto a blank area of the layout. A new text box containing the linear regression fit token will be automatically created.

Note:  an r2 value of exactly 1 denotes a perfect fit, which is rarely attained with experimental data.  The Custom Token initially displays a value of 1.00 for r2 because its value here is greater than 0.995, and statistics in FCS Express are rounded to two decimal places by default.

 We will now edit the r2 component of the Custom Token to display five digits after the decimal point.

25.  Double-click the component r2 token in formula pane of the Custom Tokens window (Fig. 27.12, number1).
26.  Click the Statistic category in the Edit Statistic dialog (Fig. 27.12, number2).
Figure 27.12 Increasing the number of digits after the decimal displayed for the r-squared component of the Custom Token

Figure 27.12 Increasing the number of digits after the decimal displayed for the r-squared component of the Custom Token

27.Increase the Number of decimals to 5 (Fig. 27.12, number3).
28.Click OK.

The linear fit token will be displayed as in Figure T27.13.

 

 

Figure T27.13  The LinFitLogMedMESF Custom Token displayed in a Text Box, after editing the number of digits displayed for r-squared

Figure T27.13  The LinFitLogMedMESF Custom Token displayed in a Text Box, after editing the number of digits displayed for r-squared

 

In the next section, we will create a linear regression overlay on a scatter plot.