eniven
February 22nd, 2008, 03:39 PM
Hi there,
I'm working on a PhD in an engineering field and it requires a bit of programming. My programming knowledge is extremely limited so I'm having a bit of a tough time with it.
I'm working on a program that parameterizes the sampling distribution for the correlation coefficient. Anyway, most of it is programmed already. But, I'm having a problem with one part of the program.
Say I have some data with 11 X and Y values. I want to calculate the correlation coefficient between them. OK, that's no problem. I've already coded that.
Now, let's say I want to leave out 1 X and Y data pair so that I'm calculating the correlation coefficient based on 10 pairs of X and Y instead of 11. And, I want to do that 11 times, leaving out a different data pair each time so that I calculate 11 different correlation coefficients based on the remaining 10 data points.
Now, I want to do the same thing, but instead of leaving out only 1 data pair, I want to leave out 2, 3, 4, ... n-3 data points.
Why up to n-3 data pairs? Because you need 3 data pairs to calculate a correlation coefficient.
If it matters, I am coding in Fortran. I know it's an old language, but it works efficiently for many of our applications and we have built up an existing library of programs in that language that have served us well and still work.
I'm not necessarily looking for you to write my code for me and maybe there aren't many of you that know Fortran very well, but I would really appreciate some help with some pseudo code at least.
Thanks so much, in advance for any help!!! I'm stumped with this one.
I'm working on a PhD in an engineering field and it requires a bit of programming. My programming knowledge is extremely limited so I'm having a bit of a tough time with it.
I'm working on a program that parameterizes the sampling distribution for the correlation coefficient. Anyway, most of it is programmed already. But, I'm having a problem with one part of the program.
Say I have some data with 11 X and Y values. I want to calculate the correlation coefficient between them. OK, that's no problem. I've already coded that.
Now, let's say I want to leave out 1 X and Y data pair so that I'm calculating the correlation coefficient based on 10 pairs of X and Y instead of 11. And, I want to do that 11 times, leaving out a different data pair each time so that I calculate 11 different correlation coefficients based on the remaining 10 data points.
Now, I want to do the same thing, but instead of leaving out only 1 data pair, I want to leave out 2, 3, 4, ... n-3 data points.
Why up to n-3 data pairs? Because you need 3 data pairs to calculate a correlation coefficient.
If it matters, I am coding in Fortran. I know it's an old language, but it works efficiently for many of our applications and we have built up an existing library of programs in that language that have served us well and still work.
I'm not necessarily looking for you to write my code for me and maybe there aren't many of you that know Fortran very well, but I would really appreciate some help with some pseudo code at least.
Thanks so much, in advance for any help!!! I'm stumped with this one.