# How to obtain p-values from a multivariable regression using the mvregress function?

21 visualizaciones (últimos 30 días)
Brett Erickson el 18 de Jul. de 2022
Respondida: Rangesh el 13 de Oct. de 2023
I have a multivariable regression model I fit using mvregress. There are 6 response variables and 9 predictor variables, which gives me a total of 60 regression coefficients (1 intercept + 9 variables). The code I have runs without error, I just want to make sure I am calculating my p-values correctly given what MATLAB spits out for results. Here is what I have:
[beta, sigma, E, V] = mvregress(Xcell,doseDifferences); %Fitting the regression model
beta %Spitting out my regression coefficients
se = sqrt(diag(V)) %standard error calculation, V is the covariance matrix
dof = n-9-1; %degrees of freedom calculation (n observations, 9 predictor variables)
tRatio = beta./se; %Calculating t-statistic
pVals = 2*(1-tcdf(abs(tRatio),dof)); %Calculating my p-values
When I run this, my p-values make sense for the most part but some of the p-values don't seem correct. Am I calcualting the p-values correctly? Are my degrees of freedom calculated correctly?
##### 1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Star Strider el 18 de Jul. de 2022
The mvregress documentation links to manova1, so that would be where I would begin to find the relevant statistics. (I’m not posting this as an answer because I don’t have any recent experience with either function.) I’m surprised that something similar to fitlm (not applicable here) that produces nice summary statistics tables doesn’t exist for mvregress.

Iniciar sesión para comentar.

### Respuestas (1)

Rangesh el 13 de Oct. de 2023
Hi Brett,
I see that you are working on calculating p-values for multivariate linear regression. In your scenario, you have 6 response variables and 9 predictor variables, which leads to a total of 60 regression coefficients. To accurately calculate the degrees of freedom, you should use the formula dof = n - p - 1, where p represents the total number of coefficients (60 in your case). This discrepancy in calculating the degrees of freedom could have caused the discrepancy in the p-values.
I hope this resolves your query.
With regards,
Rangesh P
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Linear Predictive Coding en Help Center y File Exchange.

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by