How to use splitApply to get the coefficients of fitlm?
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a table dummyTable that I would like to findgroup and then splitApply. The function in the splitApply is fitlm. So I write it as:
fit = splitapply(@(x)fitlm(x, Y~X+Dummy'), dummyTable, G);
But I keep getting an error: "Too many input arguments." Why? Thanks for any help!
0 个评论
回答(1 个)
dpb
2018-10-16
splitapply can only take a function handle, not an anonymous function. You'll have to write an intermediary function that calls fitlm with the wanted model and pass the handle to it.
另请参阅
类别
在 Help Center 和 File 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!