Calculating 2SD in iolite and Selection Matrices

A question that appears from time to time in iolite circles is how to report the 2SD instead of the default 2SE for each selection. This is something that we hope to automate in the future but, as is usually the case in iolite, the information is there, you just need to work out where it is. In this case, the information is in the selection matrices, and this post covers how these selection matrices are structured.

Firstly, what is a selection matrix? Basically, it’s just a table that stores the results for each selection within a selection group. They’re just like an Excel spreadsheet, except that they have a third dimension, a little like spreadsheets stacked on top of one another. In the tables, each row is a selection, and the columns are the channels you’ve measured (e.g. Ca43, Sr88_m88_ppm etc). The different layers are explained below, but first, where do I find these matrices in iolite?

You can find them by using the Data Browser (in the Data menu -> Data Browser). NOTE: it’s best to look at this with an existing experiment, where you’ve already made selections and run a DRS. In the Data Browser window, you can see how iolite organises the information in each experiment. There are a series of “datafolders” which are exactly analogous to the folders on your computer. If you click on the little triangles to expand the Packages datafolder, you’ll see the iolite datafolder, and within that folder you’ll see all the different datafolders iolite uses to store info. The important one here is the “integration” datafolder (make sure that Waves are selected for Display in the upper right of the Data Browser window). Within that you’ll see that there are two matrices for each selection group: one with the prefix “m_” that contains all the numeric data, and another with the prefix “t_” containing all the textual information associated with each selection (the selection label etc). The latter won’t be discussed any more in this post, but feel free to have a look at it, just being aware that if you make any changes here, it may affect your experiment, so please be careful! 🙂

iolite-databrowser example

The Igor Pro Data Browser when iolite is installed

When you double-click on the icon next to one of the m_ matrices, it will open a table in a new window and display the values in the matrix and it will print something like the line below in the History Winidow (aka the Command Window).

Edit/K=0 root:Packages:iolite:integration:m_Output_1;DelayUpdate

That’s ok, but it doesn’t by default so the column and row labels, so let’s close that window and open it again with the labels displayed. To do that, go to the Command Window and press the Up arrow key on your keyboard, and then Enter. This will copy the last command in the History Window in the Command Line ready for execution. Let’s edit that line so that it looks like the line below:

Edit/K=0 root:Packages:iolite:integration:m_Output_1.ld

The DelayUpdate bit doesn’t do anything in this case, so we’ve left that off, and we’ve added “.ld” after the matrix name. That stands for “show the label dimensions”. Hit the Enter key on your keyboard to execute this command.

You should now be able to see that the first column is the “Default Column” which is where iolite would store any info that was default for all channels. The first row is the “Default Row” and has a similar function, but you can ignore these for the time being. You should also see that for each row, and for each column there is a very large number (in the order of 3E+09), and it’s the same value or very similar for all your selections. This is the median time of each selection, stored as seconds since 1/1/1904, Igor’s internal time format. Iolite stores each selection as a median time and a time range, so that each selection can be drawn as a box centered on the median time ± this time range. It’s a little unintuitive, but it works for the drawing code in Igor. If you were to double click on any column and change the format to decimal, you’d actually see that the numbers are slightly different. So, this is the first layer: selection median time.

If you look in the top right of the window, you’ll see an up and a down arrow button. If you click on these, you can move through the layers of the matrix, so clicking down once will take you to the time-range layer (remember that this is half the time of your selection so that each selection can be drawn as the median time ± the time range). You’ll notice that for the first two layers, the value for median time and time range is the same for every channel. This makes sense in that (at the moment) any selection has the same length for all channels, but the flexibility is there for the future if we wanted to change this.

The next layer down is the mean/median for each channel, and this value does change for each channel and for each selection, as you’d expect. This is the value that was calculated according to the Stats methods you selected (or left as default) on the DRS tab.

Going down one more layer shows the 2SE value calculated for each selection, for each channel. And the layer below that is the number of data points in the selection, and the last layer is the number of points considered outliers (and therefore not used in the calculation of the mean or 2SE) in the selection time window.

To summarise, here are those layers in order:
-Selection mid-time
-Selection time range
-Selection mean/median
-Selection 2SE
-Selection No of points
-Selection No of Outliers

To calculate the 2SE, iolite uses the formula 2SE = 2 * StdDev / sqrt(no of points). To back out the 2SD value, you can use 2SD = 2SE * sqrt(no of points) for each selection.

As noted above, we hope to automate this process at some point, but in the meantime, we’re happy to have the inner workings of iolite made more transparent.

If you have any questions, please feel free to add a comment to this post.