# Multivariate Statistical analysis, regression? correlation?

3 views (last 30 days)
In-chan Kim on 16 Mar 2020
Commented: In-chan Kim on 26 Mar 2020
Hi, my statistics is not my strongest.
What's the best method for analysing for the effects of different variables on the output results on MATLAB?
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!

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 :
In-chan Kim on 26 Mar 2020
Thanks very much!
Is there any non-linear multiple regressions that would be suitable for this?