How to get the sum of squares in GLM model summary ?

조회 수: 6 (최근 30일)
Timbro
Timbro 2022년 4월 6일
댓글: Timbro 2022년 4월 8일
I want to calculate the % of variance explained by each variable in a GLM, for that I need the summ of square. Can we get it from the fitglm function output ?

채택된 답변

Ive J
Ive J 2022년 4월 6일
You can get SST, SSE and SSR:
mdl = fitglm(rand(100, 2), randi([0 1], 100, 1), 'dist', 'binomial', 'link', 'logit');
mdl.SSE
ans = 23.9711
mdl.SSR
ans = 1.0278
mdl.SST
ans = 24.9900
  댓글 수: 3
Ive J
Ive J 2022년 4월 8일
You cannot use anova on a GLM, but only an LM. The link you provided is the same. I assume your response is continuous, so you can use fitlm. Also, it's easier if you share your data.
Timbro
Timbro 2022년 4월 8일
Indeed, the response is continuous, and using fitlm I can use anova
Thank you !

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by