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

4 次查看（过去 30 天）
Matthew Burman2015-1-20

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%

### 回答（2 个）

Youssef Khmou 2015-1-20

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;
##### 0 个评论显示 -1更早的评论隐藏 -1更早的评论

Star Strider 2015-1-20
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 个评论显示 1更早的评论隐藏 1更早的评论
Star Strider 2015-1-20
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.)

### 类别

Find more on Half-Normal Distribution in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by