|
ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Analysis > Calculations > An introduction to calculations An introduction to calculations
IntroductionAlthough ANY-maze will automatically calculate a large number of different measures, there may be occasions when you want to calculate a result it doesn't supply as standard. For example, in a plusmaze protocol, you would probably define an 'Open arms zone' and this would cause ANY-maze to report (amongst other things) the 'Time in the open arms'. However, in the plusmaze it's quite common to report the 'Percentage of time in the open arms' rather than the absolute time, but this is a value which ANY-maze doesn't include as standard. The solution to this, as you'll doubtless have guessed, is to use an ANY-maze calculation. Essentially, a calculation is a way to derive a new measure from those which the system supplies automatically. However, calculations are more powerful than you might at first imagine because they can include functions which can calculate results either across or within an animal's trials. Calculation formulaeAs you'd expect, a calculation is defined using a formula. This can include absolute values, such as 100; the results of measures, such as the 'Time in the open arms'; and the four mathematical operators: plus, minus, multiply and divide. Here, for example, is a simple calculation formula: Time in NW zone / 2 ANY-maze calculates the results of a formula by working from the left to the right, so the result of: 20 / 2 + 3 would be 20 / 2 = 10 + 3 = 13. Of course you might have wanted to divide 20 by the sum of 2 and 3, in which case the above formula will give you the wrong answer. To fix it, you need to include parentheses to change the calculation order. For example, the result of the formula: 20 / ( 2 + 3 ) would be 2 + 3 = 5, 20 / 5 = 4. You can nest parentheses if you need to - for example, the result of: 20 / ( 5 - ( 2 + 1)) would be 10. Of course, to be useful, a calculation won't just contain numbers but will include the result of at least one measure, or perhaps the result of another calculation. You can easily incorporate the results of almost all the standard measures in calculations. I say almost, because some measures, such as 'First zone entered', yield non-numeric results which clearly can't be used in a calculation. FunctionsAs I mentioned in the introduction, calculations can include functions which allow you to calculate results both across and within an animal's trials. For example, imagine you ran a 5-minute test and you'd like to find out what percentage of the total distance travelled by the animal occurred in the first 2 minutes of the test. The formula for this would be: ( ResultForPeriod { Total distance travelled, 0 - 120 } / Total distance travelled ) * 100 Here the function ResultForPeriod extracts the total distance travelled for just the first 120 seconds of the test (that's what the 0 - 120 bit means). Don't worry if this formula looks a bit complicated, because ANY-maze includes a function wizard which will guide you through the process of choosing and defining a function for inclusion in a calculation. The ResultForPeriod function extracts a result from within a test, but what about those functions I mentioned for results across trials? Well, there are a number of them: Count, Sum, Mean, Max, and Min. For each one, you define the first and last trial you want the function to include, and it will calculate the result across the trials. For example: Sum { Total distance travelled, Acquisition: Trial 1 - Acquisition: Trial 3 } would sum the distance travelled in an animal's first 3 acquisition trials. Again, the function wizard will help you actually create the function, so you needn't worry about the exact syntax used.
Calculation resultsOnce you've defined a calculation, its result can be treated just like any other measure. This means you can include the result in reports, create graphs of the result, and even perform statistical analysis on it. It also means that you can include the result in other calculations, which can occasionally be extremely useful.
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T0614 |