フィルターのクリア

How to extract p-value from regress and corrcoef ?

52 ビュー (過去 30 日間)
Belal Abboushi
Belal Abboushi 2015 年 3 月 5 日
回答済み: aikaterini vraka 2021 年 6 月 4 日
Hello everyone,
I was able to write the code to run regress and corrcoef but didn't know how to get the p value.
What exactly do i need to write before = in order to get these values? [ ?? ]= regress(speed',weight)
Any idea how to get these out of regress and corcoeff?

採用された回答

Star Strider
Star Strider 2015 年 3 月 5 日
From the documentation for regress:
[b,bint,r,rint,stats] = regress(y,X) returns a 1-by-4 vector stats that contains, in order, the statistic, the F statistic and its p value, and an estimate of the error variance.
From the documentation for corrcoef:
[R,P]=corrcoef(...) also returns P, a matrix of p-values for testing the hypothesis of no correlation. Each p-value is the probability of getting a correlation as large as the observed value by random chance, when the true correlation is zero. If P(i,j) is small, say less than 0.05, then the correlation R(i,j) is significant.
I can’t describe it better than the documentation does.
  2 件のコメント
Belal Abboushi
Belal Abboushi 2015 年 3 月 5 日
Thank you!
Star Strider
Star Strider 2015 年 3 月 5 日
My pleasure!

サインインしてコメントする。

その他の回答 (1 件)

aikaterini vraka
aikaterini vraka 2021 年 6 月 4 日
Hi,
Just a question. Since regression shows the one-way relationship, should I get the same p-value and R-squared if I interchange predictor and response variables? Or should they vary?
I use the same function but when I write e.g regress(weight,speed ), I see the same p-values as before and the only term that varies is the error variance? Is this correct?

カテゴリ

Help Center および File ExchangeSpecification Testing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by