# Method: Fear Conditioning Analyzer (method version 1.0.0)

## Calculation

For each animal, from freezing percentages scored during the recall tests:

1. **Cued freezing** = freezing during the CS (%) − freezing in the pre-CS period (%), in percentage points. It is negative when the animal froze less during the CS than before it.
2. **Contextual freezing** = freezing in the conditioning context (%).
3. **Generalisation score** = freezing in the conditioning context (%) − freezing in a neutral context (%), in percentage points.
4. **Group statistics** per group: mean, standard deviation (n − 1 denominator) and SEM = SD / √n.

## Conventions

- Freezing values are percentages entered by the user; the tool does not score video.
- Post-CS freezing and shock intensity are recorded with each animal but do not enter the calculations.
- A group with one animal has no standard deviation; the tool reports its SEM as 0, so it has no error bar.
- A value that is not a finite number is left out of its group; an animal with no group name is placed in "unassigned".

## Worked examples

Four cases in `cases.json`: cued freezing, a generalisation score, a group mean and SEM worked by hand, and a group with one animal (edge case).

## References

- Curzon P, Rustay NR, Browman KE. Cued and contextual fear conditioning for rodents. In: Buccafusco JJ, editor. Methods of Behavior Analysis in Neuroscience. 2nd ed. Boca Raton (FL): CRC Press; 2009. https://doi.org/10.1201/noe1420052343.ch2

## Changes from the page before this record

- Calculations are unchanged.
- The method note said cued freezing used the "mean" CS and pre-CS freezing; each animal has one CS value and one pre-CS value, so the note now says "the CS freezing percent minus the pre-CS freezing percent".
