What formula for r-squared does fitlm use in the weighted linear regression case?

조회 수: 11 (최근 30일)
If I use fitlm as:
mdl = fitlm(X,Y,'Weights',W);
can someone tell me the formula used in computing the r-squared that's here:
mdl.Rsquared.Ordinary
I am seeing a different result when compared to JMP. Thanks.

답변 (1개)

Matt J
Matt J 2024년 2월 7일
  댓글 수: 2
Paul Safier
Paul Safier 2024년 2월 7일
편집: Paul Safier 2024년 2월 7일
Thanks @Matt J. It says Rsq = 1 - SSE/SST. Not seeing where the equation for SSE or SST is given in the weighted LS case. It ought to be different for OLS vs WLS. I'm interested in what MATHWORKS uses specifically for WLS.
Matt J
Matt J 2024년 2월 7일
편집: Matt J 2024년 2월 7일
I don't believe weights are taken into account in the computation of R2. This should be easy to verify, by comparing the stack exchange formulas (both weighted and unweighted) to what Matlab gves you.

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

카테고리

Help CenterFile Exchange에서 Resampling Techniques에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by