Greetings,

In an effort to compare two sets of N observations (A and B) at a point in time (t). I have computed the following statistics:

mean(A)

std_dev(A)

error_upper(A) = mean(A) + ( 1.96 * ( std_dev(A) / sqrt(N) ) )

error_lower(A) = mean(A) - ( 1.96 * ( std_dev(A) / sqrt(N) ) )

mean(B)

std_dev(B)

error_upper(B) = mean(B) + ( 1.96 * ( std_dev(B) / sqrt(N) ) )

error_lower(B) = mean(B) - ( 1.96 * ( std_dev(B) / sqrt(N) ) )

I wish to plot these results with error bars using gnuplot, which can be acheived if the data has the form:

t Y_val Y_err

My qusetion relates to the correct calculation of the error value (Y_err). To plot the error bars for the first set of observations (A) should I use:

t mean(A) ( error_upper(A) - error_lower(A) )

or, should it be

t mean(A) ( error_upper(A) - error_lower(A) ) / 2

??

The goal is to visually depict a 95% confidence interval.

Any help on this matter would be hugely appreciated.

Many thanks,

dan