>> i have xy data as such (i hope that the pic works):
>> http://img175.imageshack.us/i/77916937.jpg/
>> where there are multiple y values for every x. how do i calculate an
>> average value for each x and how do i make the 90% confidence interval
>> and plot them?
>>
>> any suggestions?
> there are multiple y for each x (not the same number also).
Robert, in general the errorbar function is good for plotting averages error
limits. It requires that you calculate those averages and limits separately,
though.
The plot you pointed out looks a lot like x/y data where you could imagine
fitting y=f(x)+error and asking for error limits around that. But I think
you're asking how to compute averages of y values at the distinct x values.
So take a look at this code and see if you can figure out how to adapt it to
your situation (for example to specify the confidence level):
x = randi(20,120,1);
y = x + randn(size(x));
plot(x,y,'bx')
[m,ci,g] = grpstats(y,x,{'mean' 'meanci' 'gname'})
g = str2num(char(g));
line(g,m,'color','r')
line(g,ci,'color','r','linestyle',':')
 Tom
