Print statistics model output that is shown in command window
2 次查看(过去 30 天)
显示 更早的评论
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
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 Center 和 File Exchange 中查找有关 MATLAB Report Generator 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!