Test simple regression slope

20 visualizaciones (últimos 30 días)
Martijn Steenwijk
Martijn Steenwijk el 26 de En. de 2016
Respondida: Star Strider el 26 de En. de 2016
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)

Respuestas (1)

Star Strider
Star Strider el 26 de En. de 2016
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.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by