P value of corrcoef() is aways different !
Mostrar comentarios más antiguos
Hi, in my tests i've introduced Matlab corrcoef(). But if i repeat this test i'm used to obtain different results for p value. The same thing if i cosider rand() function. So :
t=1:200000;
a=rand(1,200000);
[l,p]=corrcoef(a,t)
first time
l =
1.0000 0.0016
0.0016 1.0000
p =
1.0000 0.4742
0.4742 1.0000
second time
l =
1.0000 0.0025
0.0025 1.0000
p =
1.0000 0.2729
0.2729 1.0000
third time
l =
1.0000 -0.0000
-0.0000 1.0000
p =
1.0000 0.9941
0.9941 1.0000
what is the meaning of these results?
2 comentarios
Jeff Miller
el 13 de Mzo. de 2018
You seem to be generating new random values of 'a' for each run, so the correlations of those values to 't' (which are returned in 'l') naturally vary randomly as well. Since the correlations vary, so do their associated p values. What aspect of this is surprising to you?
Damiano Capocci
el 14 de Mzo. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
