Test simple regression slope

조회 수: 15 (최근 30일)
Martijn Steenwijk
Martijn Steenwijk 2016년 1월 26일
답변: Star Strider 2016년 1월 26일
I would like to test whether the slope of a simple y=a*x+b linear regression line equals one. Is the following approach correct?
stats = regstats(y,x,'linear'); % y is a vector of responses, x is a vector of data
beta = stats.beta % this prints the betas of the model
%Perform an F-test that the last coefficient is equal to 1:
SIGMA = stats.covb;
dfe = stats.fstat.dfe;
H = [0 1];
c = [1];
[p,F] = linhyptest(beta,SIGMA,c,H,dfe)

답변 (1개)

Star Strider
Star Strider 2016년 1월 26일
Most hypothesis tests on the parameters test if the parameter is different from zero. My reading of the documentation for regstats and linhyptest leads me to believe they do the same.
In order to see if the parameter is different from a number other than zero, you need the actual confidence limits. If those confidence limits for the slope include 1, then it is not significantly different from 1. The regress function will give you that in ‘bint’ if you as it as:
[b,bint] = regress(y,X);
and remember to include the vector of ones to create an intercept parameter and statistics for it.
Another option is to use polyfit and the File Exchange contribution ‘polyparci’ to get the confidence limits on the parameters.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by