Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: regstats - How to understand tstat.pval
Replies: 0

 giusep Posts: 6 Registered: 4/3/12
regstats - How to understand tstat.pval
Posted: Sep 24, 2013 11:02 AM

Hi guys,
I have 2 vectors and I want to check whether there is some correlation between the:
1st value of the 1st vector vs 1st value of the 2nd vector,
2nd value of the 1st vector vs 2nd value of the 2nd vector,
3rd value of the 1st vector vs 3rd value of the 2nd vector,
etc etc.....

I am not sure if I am doing properly, but I am using the function: regstats in order to see if there is correlation or not.
In particular I get the Rsquare and the Pvalue. The problem is that the Pvalue contains 2 values.... and I don't know what do this values come from.
Could someone help me? Thank you!

example:
taking 2 vectors:
a = [1 2 3 4 5 ];
b = [2 4 6 8 10];
regstats([1 2 3 4 5 ],[2 4 6 8 10])

I get:
pval = 1;
1,86423910651118e-47;

Rsquare = 1

Ok about the Rsquare!
But how about the pval? Why 2 values? I was expected to have pval =0. wasn't it?

Thank you