NeuroAnalyzer tutorials: Statistics (1)

Calculate CI using bootstrapping

Get 1st channel for all epochs and calculate its 95%CI

s = eeg.data[1, :, :]
t = eeg.epoch_time
s_avg, s_l, s_u = bootstrap_ci(s, ci=0.95)
p = plot_ci(s_avg, s_l, s_u, t)
plot_save(p, file_name="images/ci.png")

Calculate statistic using bootstrapping

Any statistical function may be calculated using bootstrapping method. The function must be provided as f="function_name(OBJ)", OBJ will be replaced with the signal data, e.g. f="mean(OBJ)".

s = eeg.data[1, :, :]
s_stat = abs(maximum(s))
s_dist  = bootstrap_stat(s, f="abs(maximum(OBJ))")
p = plot_histogram(s_dist, s_stat, draw_median=true, draw_mean=false)
plot_save(p, file_name="images/stat_bootstrap.png")

Output:

[ Info: Proportion of values > 3.8: 0.058
[ Info: Proportion of values < 3.8: 0.942