spiketools.stats.trials.compute_pre_post_ttest

spiketools.stats.trials.compute_pre_post_ttest(frs_pre, frs_post)[source]

Compute a related samples t-test between the pre & post event firing rates.

Parameters:
frs_pre, frs_post1d array

Firing rates across pre & post event windows.

Returns:
t_valfloat

The t-value of the t-test.

p_valfloat

The p-value of the t-test.

Examples

Compute the t_value & p_value computed on the pre & post event firing rates:

>>> frs_pre = np.array([1.5, 1.8, 1.9, 2.0, 2.2])
>>> frs_post = np.array([5.5, 6.5, 6.6, 6.7, 7.1])
>>> compute_pre_post_ttest(frs_pre, frs_post)
(-29.692872320923538, 7.660650245217322e-06)