Clear Filters
Clear Filters

Multivariate regression p-values

3 views (last 30 days)
Maria445
Maria445 on 23 May 2018
Commented: Maria445 on 24 May 2018
I am performing a multivariate regression analysis using mvregress. To compute the standard errors of the coefficient estimates, I am using sqrt(diag(CovB)), where CovB is one of the outputs of mvregress.
Just to check, I also run the same multivariate regression on R. To my surprise, the coefficient estimates are the same, but the SEs they provide are completely different. So I checked the variance-covariance matrix of the coefficient estimates in R, and it is totally different from Matlab's CovB.
Moreover, the difference is so relevant that almost all coefficient appear statistically significant in Matlab, and none of them in R.
Which software should I trust?
  2 Comments
the cyclist
the cyclist on 24 May 2018
Edited: the cyclist on 24 May 2018
I can't dig deeply into this right now, but here is my perspective. Both R and MATLAB are extremely reliable software packages. Almost certainly, neither of them is wrong in what has been calculated. In my experience, problems like these are usually in the assumptions/interpretation of the user about the meaning of the output of each package.
So, to cast this in your language -- you should trust both software packages, and not your own understanding. Sorry if that seems a bit harsh, but it's my best guess as to what is going on.
If you can post a small example that exhibits the issue you are seeing, with both the R and the MATLAB code, someone might be able to help you suss it out. Who knows, maybe there really is a bug in one package or the other.
Maria445
Maria445 on 24 May 2018
You were right, none of them was wrong; the difference in the variance-covariance matrix of the coefficient estimates was due to the fact that Matlab was using the cwls algorithm, while R was solving using the maximum likelihood method...now I'm just wondering why the 2 methodologies lead to such different results in terms of significancy of the parameters

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!