필터 지우기
필터 지우기

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

조회 수: 17 (최근 30일)
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
Star Strider
Star Strider 2022년 7월 18일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Rangesh
Rangesh 2023년 10월 13일
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

카테고리

Help CenterFile Exchange에서 Regression에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by