# how can I determine the mean intervals given a confidence level of 98%?

2 views (last 30 days)
Matthew Burman on 20 Jan 2015
Commented: Star Strider on 20 Jan 2015
I have a table of values for two seperate timings for an experiment. Is there a coding I can follow to determine the mean intervals? Literally hit a brick wall on this question. Any help would be greatly appreciated. The data is as follows...
T1 (37.79 39.51 38.54 39.14 39.02 39.4 39.01 37.18) T2 (22.4 22.07 22.15 21.72 21.75 22.55 22.18 21.92) Confidence level = 98%

Youssef Khmou on 20 Jan 2015
Edited: Youssef Khmou on 20 Jan 2015
Try :
t1=[37.79 39.51 38.54 39.14 39.02 39.4 39.01 37.18];% T2 (22.4 22.07 22.15 21.72 21.75 22.55
22.18 21.92];
t2=[22.4 22.07 22.15 21.72 21.75 22.55 22.18 21.92];
N=length(t1);
m1=mean(t1);
m2=mean(t2);
std1=std(t1);
std2=std(t2);
s1=std1/sqrt(N);
s2=std2/sqrt(N);
You have to look for critical value t from table, assuming that the samples are small, drawn from normal distribution with known variance. Additionally, the variables are not correlated.
t=2.977;
% Confidence ranges
m1max=m1+t*s1;
m1min=m1-t*s1;
m2max=m2+t*s2;
m2min=m2-t*s2;

Star Strider on 20 Jan 2015
The means are easy:
T1 = [37.79 39.51 38.54 39.14 39.02 39.4 39.01 37.18];
T2 = [22.4 22.07 22.15 21.72 21.75 22.55 22.18 21.92];
T1mean = mean(T1);
T2mean = mean(T2);
The confidence intervals aren’t. What are your data? Consider that ‘timings’ (and I have no idea what you mean by that) could be modeled as a Poisson process, so you would have to use the poissfit and poissinv functions.
If your data are something else, you could conceivably model them as exponentially distributed or even normally distributed. Without knowing more, I have no idea.
The point is that the confidence interval calculation is not trivial, and requires that you understand the statistical properties of the process that generated your data in order to calculate them correctly.
##### 2 CommentsShowHide 1 older comment
Star Strider on 20 Jan 2015
My pleasure.
In that situation, you can assume they are normally distributed, but given that you have only 8 observations in each vector, they are actually t-distributed. Use the tinv function to calculate the confidence intervals. If you want to see if ‘T1’ and ‘T2’ are statistically different, use the ttest function. See the ‘Examples’ -> ‘Paired-Sample t-Test’ for details. (You may need to consult a reference to determine how to calculate the degrees-of-freedom for both the confidence interval and t-test.)