Multivariate Regression Test Statistics

I have designed a multivariate regression with two response (Y) and three predictor (X) variables using mvregress. The response variables are horizontal and vertical eye position (h, v) and the predictor variables are a constant term with horizontal and vertical gaze position (x, y). How do I compute a p-value for each of my coefficients given what the function returns?
% multivariate regression
n = numX * numY; % number of gaze positions
d = 2; % number of response variables
numCoeffs = d * 2 + d;
X0 = ones(n, 1);
X1 = XX(:);
X2 = YY(:);
X = [X0, X1, X2]
Y1 = H;
Y2 = V;
Y = [Y1, Y2];
% coefficients, covariance matrix, residuals, variance of parameters, loglikelihood value, correlation matrix
[B, S, R, V, L] = mvregress(X, Y);
predY = X * B;
C = corrcov(S);
E = sqrt(diag(V));

4 Kommentare

The standard errors for the regression coefficients are the square root of the diagonal of the variance-covariance matrix, V.
se = sqrt(diag(V))
The lack of formalized output tables similar to SAS or other statistics packages is a real weakness in using MATLAB Statstics Toolbox for routine stastitical analysis. Having to do all the rest of the work is just something that users should not have to spend their time having to do -- should have all been pre-packaged, at least as options to prepare the ANOVA tables, etc., etc., ...
It's occasionally useful in repetitive situations to have coefficients and models that can be manipulated programmatically, granted, but that, in general, is not the most desired output in a typical application.
$0.02, imo, ymmv, etc., etc., etc., ...
Kevin Willeford
Kevin Willeford am 13 Feb. 2021
Thank you! I have done that above. I am rusty on how to go from the standard errors to a p-value, moreso in the case above where there are two dependent variables.
Do I divide the estimated coefficients (B) by the standard errors (E) to get a Z value? And then, how to go from Z to P...?
Yeah, same as for OLS, if you ran a separate OLS regression for each outcome variable you would get the same coefficients, standard errors, t- and p-values, and confidence intervals.
So, for each b,
t=b/SE;
p>|t| --> 2*(1-tcdf(t,dof))
I have two response variables, three predictor variables, and thus a total of six coefficients returned. I believe the DOF = 3 in this case because there are three predictor variables for each response variable. When I followed the above procedure, I got p values greater than 1.00 which cannot be correct?
[B, S, R, V, L] = mvregress(X, Y);
predY = X * B;
C = corrcov(S);
SE = sqrt(diag(V));
T = B(:) ./ SE;
P = 2 * (1 - tcdf(T, DOF));
B =
1.496605020258772 -0.000313029492716
0.000389624484379 -0.004938677958117
-0.053311651917679 0.000022111435119
SE =
0.011649490387665
0.000658994692039
0.000658994692039
0.000807196421197
0.000045661925054
0.000045661925054
T =
1.0e+02 *
1.284695699516166
0.005912407020668
-0.808984542087009
-0.003877984149776
-1.081574627492846
0.004842422892381
P =
0.000001039860816
0.595950373533595
1.999995836953775
1.275955907490467
1.999998257520655
0.661365573305742

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Gefragt:

am 12 Feb. 2021

Kommentiert:

am 15 Feb. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by