Print statistics model output that is shown in command window

조회 수: 1 (최근 30일)
KJ
KJ 2017년 6월 30일
댓글: Daemonic 2021년 8월 3일
Hi all, (this question probably applies to all statistics models):
I have built a mixed effects model using fitlme() and when you don't use the semicolon, for example
lm=fitlme(data, 'y ~ x1 + x2*x3 + (1|x4)')
the model properties and diagnostics gets printed in the command window, including the model information (number of observations, numbers of coefficients etc), the formula, the model fit statistics, the fixed and random effects coefficients/covariance parameters with 95% CIs, p-values, etc.
Is there a quick/elegant way to write all of this output into an external file (preferably xls) without going into the lm object variable, getting each of the properties and printing it 'manually' by writing my own lines using xlswrite()? I also seem to not be able to find some of the properties that get shown in the command window within the lm object, so I was wondering specifically if there was an automatic way of writing the full output into some file.
Thanks!
  댓글 수: 1
Daemonic
Daemonic 2021년 8월 3일
I'm sure you've gotten your answer by now. However, just in case, you can print the output of the model into a text file with the following:
diary('filename.txt')
lm
diary off
You can also place into a csv or xls however the tab delimiter does not carry over unfortunately.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by