Confidence Interval on the mean curve (SSANOVA)

5 views (last 30 days)
Phil
Phil on 21 Apr 2013
I am doing signal processing with a machine called EMA. It works by putting sensors on a participants tongue and records the X,Y,Z coordinates of those sensors over time.
I have put the data into MATLAB and I can calculate the mean of the series of tokens I have, but I cannot figure out how to put 95% confidence intervals around the mean curve that is produced. Could anyone help me?
Below is what I have for plotting the mean, if anyone can help me plot the 95% confidence intervals, I would be very grateful.
Sincerely,
Phil
% these refer to different matrices storing specific data for specific tokens.
cons = 'rr'; env = '#_a';
%these store the trial numbers of consonant, environment of interest consinds = strind(CONS, cons); envinds = strind(ENVIRONMENT, env); consenvinds = intersect(consinds, envinds);
%%%%
%%change this to consinds, envinds, consenvinds indices_of_interest = consenvinds; %%%%%
meangamma = mean(cell2mat(GAMMA(indices_of_interest)'));
hold on plot(meangamma, 'g')

Answers (1)

Tom Lane
Tom Lane on 23 Apr 2013
I'm having trouble understanding the code you wrote.
Perhaps you can figure out how to compute the mean and std for each group. The standard error of the mean, or sem, is std/sqrt(N) for N observations. A 95% confidence interval is about +/- 2*sem from the mean. You could use the errorbar function for plotting.
If you have the Statistics Toolbox, type "help grpstats" and you may find something helpful.
  1 Comment
Phil
Phil on 25 Apr 2013
Edited: Phil on 25 Apr 2013
I am having trouble making an errorbar... it returns the error X, Y and error bars must all be the same length.
I tried the code, e = std(meangamma); errorbar(meangamma,e)
If you have suggestions for making that work it would be great.
As far as my code, it's simple code but a complex series of data.
The matrix GAMMA has, in each cell, another matrix. Those matrix each refer to a token. Those are divided up by both token and the environment. hence the code cons and env. Those refer to other matrices which refer to which token and which environment in GAMMA fits whatever I put in there. Each token is a vector which would produce a curve if plotted separately. Meangamma plots the mean of all the tokens.
I was really hoping to get something like http://www.mathworks.com/help/matlab/data_analysis/programmatic-fitting.html#bqm3cio-1 for my confidence boundaries, but I really am having issues figuring out the code I would need to do that.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!