Running Statistics - xcorr and mad
2 views (last 30 days)
Show older comments
Hello,
I apologize as this question may have more to do with stats then matlab but hoping I can get some help.
I have two columns of data that are about 1600 by 1, they are knee joint angles. Lets just say one is varible a and one is varible b. They are angles from the same knee from the same trial but using two different methods. I want to compare the methods.
1. First, I want to run a crosscorretional to examine the wavefroms. So my code reads, [r lag]=xcorr(a,b,'coeff'); this gives me the normalized r value and the lag at each data point.
If I want to run the cross correlation to examine the relationship between a and b did I do this correctly, is that what the code is doing?
Also, this is more of a stat question (trying to improve my understanding): How do you determine significance for cross correlation and can you provide example of the code in matlab?
2. I also want to get the absolute mean difference of the two methods. I was having trouble finding the code for doing the absolute mean diff on two sets of data; I have mad(a,b) in my code right now.
Is this the correct function to calculate abs mean diff, and is that the correct way to do it (a,b). Is it giving me the average mean diff between data set a and data set b?
Also how do I get significance for abs mean diff, and if possible could someone provide example of how the code would look?
3. I also want to do a bland-altman plot in matlab of a and b. I know how to make it from stratch and can write the code for it if nesscary, but was wondering if matlab has a built in function I was missing to create a bland-altman plot and what the code would look like if it does?
I know time is very vaulable and anyone that takes time to anwser and help me learn, I sincererly appeciate it!!
Thank you!
8 Comments
Jeff Miller
on 8 Feb 2021
Yes, that is one of the pictures I had in mind. It seems obvious that when a goes up (down), b does the same. If you want a significance level to support that statement, you can just use 'corr' command as Ive J suggested.
Obviously the blue line is above the orange one, so the two measures are not numerically equal, even though they show the same pattern. You could document that with a simple 'regress' command (predicting a from b, or vice versa), as Ive J also suggested.
To get the mean absolute difference, which you asked about earlier, I would think you would simply compute
mad = mean(abs(a-b));
Maybe you have other questions as well, but it really seems to me that the above picture nicely captures all of the information in your dataset.
Answers (0)
See Also
Categories
Find more on Descriptive Statistics 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!