Finding P-Values with the Null Hypothesis Being a Coefficient Equal to 0

조회 수: 13 (최근 30일)
Claire Hollow
Claire Hollow 2020년 7월 6일
답변: Jeff Miller 2020년 7월 7일
Hello. I apologize because this is as much of a statistical question as it is a Matlab question but I am extremely lost and need some help. I have a 72x1 double (titled x) that is basically just 1948-2019 and I have another 72x1 (titled y) double that is has the numbers of days over a certain temperatures for the each of 72 years. I found the least-squares linear regression of the data by doing
p=polyfit(x,y,1);
slope=p(1)
intercept=p(2)
which give me a slope of -0.0254 and a y-intercept of 83.6282.
Now I need to find p-value with the null hypothesis being a coefficient equal to zero (neutral trend). Im gonna be honest I have zero clue how to do this. I am aware of p-values but I do not know how to go about this, please help!

답변 (1개)

Jeff Miller
Jeff Miller 2020년 7월 7일
The easiest way is with the corr function, because the p value for the slope is the same as the p value for the correlation coefficient:
[rho, pvalue] = corr(x,y);
You should also look at a scattergram to make sure that it looks like a cloud of points with no outliers, etc
scatter(x,y)

카테고리

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