필터 지우기
필터 지우기

Linear mixed models: how to get adjusted whole model values?

조회 수: 3 (최근 30일)
LukeJes
LukeJes 2023년 1월 6일
답변: the cyclist 2023년 1월 6일
Hi all,
Does anyone know if there is a way of obtaining the "adjusted whole model" (x-axis) values from fitlm?
It is possible to obtain the "fitted" (y-axis) values, but I cannot do this for the x-axis values. I ask this because in the graph below I would like to convert the x-axis values from negative to positive for interpretation purposes.
Any suggestions?

답변 (1개)

the cyclist
the cyclist 2023년 1월 6일
I'm not sure if there is a more fundamental way to do this, but you can extract the data from the plot.
load carsmall
Year = categorical(Model_Year);
tbl = table(MPG,Weight,Year);
mdl = fitlm(tbl,'MPG ~ Year + Weight^2');
figure
h = plotAdded(mdl);
% h has three handles. In this case, the first one has the data.
% (In your case, you may need to look at h to figure out which handle is correct.)
xData = h(1).XData;
% Show a few values
xData(1:5)
ans = 1×5
-4.5401 -4.6563 -4.4950 -4.4930 -4.5038

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by