How to use splitApply to get the coefficients of fitlm?
조회 수: 3 (최근 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에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!