Multivariate Statistical analysis, regression? correlation?
25 views (last 30 days)
Show older comments
Hi, my statistics is not my strongest.
What's the best method for analysing for the effects of different variables on the output results?
I want to see how the variables in the graphs such as total duration of trips, total distance etc affect the results OF and benefit comp. See if some of them effect the results more than others.
Thanks!
0 Comments
Answers (1)
Sourabh Kondapaka
on 24 Mar 2020
The best approach would be to use Correlation when analyzing effect of a specific variable on another variable.
The function "Corrcoef()" can be used to get the correlation between all columns or for a specific column.
If your data is in the form of a matrix, say matrix “A”:
R = corrcoef(A)
% R is a matrix of correlation coefficients for A, where the columns of A
% represent random variables and the rows represent observations
R = corrcoef(A,B)
% R is matrix of coefficients between two random variables A and B.
After obtaining the correlation matrix. You can check for the specific column which is the result variable.
In your case it is “OF”. Check the column “OF” against each of the rows.
If your data is in the form of a table instead of a matrix then you can use the “corr()“ function. Here “X” is the table.
R = corr(X{:,:});
% Or you could use :
R = corr(X.Variables);
For reference on corrcoef() function :
For reference on how correlation coefficients are calculated:
In case you want to visualize / plot the correlation matrix, you can use “corrplot()” function.
For reference on corrplot() function :
0 Comments
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!