To learn working with regression we will pick up from where we left off in the previous section of this tutorial.
If you didn't go along the previous section, you can directly start with the FITC MESF Beads - Part2.fey layout stored in the Calculating MESF From Regression folder of the Tutorial Sample Data archive.
As a first step we will 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, ).
2.Right-click in the text box on the plot and select Insert Token from the pop-up menu (Fig. T27.8, ).
3.Double-click Statistic in the Insert a Token dialog (Fig. T27.8, ).
Figure 27.8 Adding a regression token to the plot
4.Click the Statistic category in the Create Statistic dialog (Fig. T27.9, ).
5.Select Regression Parameter Statistics from the Select a Statistic dropdown menu (Fig. T27.9, ).
6.Select m (slope) from the Statistic list (Fig. T27.9, ).
7.Increase the Number of decimals to "4" (Fig. T27.9, ).
8.Click OK (Fig. T27.9, ). The slope (m) of the regression curve is now displayed on the plot.
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, ). 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. Open the Custom Token window by clicking on View→Token→Custom Tokens in the Ribbon bar.
13. Click the blue plus () in the Custom Tokens window (Fig. 27.10,
).
Figure T27.10 Creating the Linear Regression Fit Custom Token
14. Highlight the "New Custom Token" text in the Custom Tokens window (Fig. 27.10, ).
15. Type 'LinFitLogMedMESF' (Fig. 27.10, ).
16. Type "m=,b=,r2=" in the formula (lower) pane of the Custom Tokens window (Fig. 27.10, ).
17. Click on the Scatter with Regression plot so its border becomes highlighted.
18. 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, ).
19. Double-click Statistic token from the Paste Special dialog (Fig. 27.11, ).
Figure 27.11 Inserting a regression parameter token as a component of the linear regression fit custom token
20. Choose Regression Parameter Statistics from the Select a Statistic dropdown menu (Fig. 27.11, ).
21. Choose m from the Statistic list (Fig. 27.11, ).
22. Click OK (Fig. 27.11, ).
23. 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
24. 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
25. 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.
26. Double-click the component r2 token in formula pane of the Custom Tokens window (Fig. 27.12, ).
27. Click the Statistic category in the Edit Statistic dialog (Fig. 27.12, ).
Figure 27.12 Increasing the number of digits after the decimal displayed for the r-squared component of the Custom Token
28.Increase the Number of decimals to 5 (Fig. 27.12, ).
29.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
Once a linear regression is calculated it can be used as model for fitting unknown samples. This can be done directly within the same layout in which the regression has been calculated (see the Apply Regression to an FCS File section of this tutorial) or in any new layout. To use the regression in a new layout see the Save a Regression topic of this tutorial.