필터 지우기
필터 지우기

mdl object: put "F-statistic vs. constant model: ... , p-value = ..." into variable

조회 수: 5 (최근 30일)
Evan
Evan 2015년 8월 20일
댓글: fateme 2022년 1월 9일
fitlm() displays, among other things, the F-statistic and p-value for the fit as a whole. I can't find these values in the mdl object, however. Could someone point me to how I can find, or calculate this value using the data in the mdl object?

답변 (2개)

gusjammo
gusjammo 2015년 9월 8일
Hello Evan, I think that you may be able to do it with coefTest(mdl), although this defaults to a horizontal line along the x-axis, so you might have to override the default with the average y-value, for instance.
  댓글 수: 1
fateme
fateme 2022년 1월 9일
Hi the question is for long time ago but maybe this answer helps others. Yes as Gusjammo said based on the help of Matlab this works:
[p,F] = coefTest(mdl)
However for me,this function gives NaN inspite of showing values of p , F by typing 'mdl'.

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


the cyclist
the cyclist 2015년 8월 20일
I'm not sure it is very well documented, but if you type
mdl.
at the command line, you will see the list what is included in the model object.
The P-values are
mdl.Coefficients.pValue
or
mdl.anova.pValue
and the F-stat is
mdl.anova.F
  댓글 수: 4
Evan
Evan 2015년 8월 20일
편집: Evan 2015년 8월 20일
It is curious though that anova seems to be a property of the mdl object, yet it's not listed when you call the function properties(mdl)... Typing "mdl." in the command line for me just returns an error: "Error: Expression or statement is incomplete or incorrect."
the cyclist
the cyclist 2015년 8월 20일
I misspoke when I said to enter "mdl." in the command window. What you should do is type "mdl." without hitting Enter, and then hit Tab to see the possible completions of that. Then you will see things like Coefficients, etc.

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

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by