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

Matthew Burman

### Matthew Burman (view profile)

님이 질문을 제출함. 20 Jan 2015
최근 활동 Star Strider

### Star Strider (view profile)

님이 댓글을 추가함. 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%

로그인 to comment.

## 답변 수: 2

### Youssef Khmou (view profile)

on 20 Jan 2015
Edited by Youssef Khmou

### Youssef Khmou (view profile)

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;

로그인 to comment.

### Star Strider (view profile)

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.

Matthew Burman

### Matthew Burman (view profile)

on 20 Jan 2015
Thanks for getting back to me. Basically the question is based on an experiment of a cart rolling down a slope. The experiment is repeated 8 times in milliseconds and the data is given in the t1 and t2 lists in my original post. The question asked me to determine the mean intervals for both t1 and t2 given that the confidence level is 98%
Star Strider

### Star Strider (view profile)

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.)

로그인 to comment.