how to find correlation coefficient ?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
pruth
il 11 Mar 2016
Commentato: pruth
il 17 Mar 2016
hello, I have a mat file, which has two columns. file attached.
I want to find a correlation coefficient between these two columns.and p-value also. and also want Plot the Pearson's linear correlation coefficients between these two.
Risposta accettata
Muhammad Usman Saleem
il 11 Mar 2016
Try from them
https://www.quora.com/How-do-I-get-one-correlation-coefficient-or-r-value-in-MatLab
4 Commenti
Muhammad Usman Saleem
il 16 Mar 2016
Modificato: Muhammad Usman Saleem
il 16 Mar 2016
because you have not define a variable before
See this
a=[1 2 3;4 5 6] % creating a matrix
a =
1 2 3
4 5 6
A= a(:,2); % means all rows with second column of a matrix
B = a(:,3); % means all rows with third column of matrix
[R,P] = corrcoef(A,B) %cross correlation
R = % 1 showing good correl
1 1
1 1
P = %depends upon your data set NaN means no corr
1 NaN
NaN 1
hope this will be fine.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!