How to use splitApply to get the coefficients of fitlm?

조회 수: 3 (최근 30일)
JFz
JFz 2018년 10월 16일
편집: dpb 2018년 10월 17일
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!

답변 (1개)

dpb
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.
  댓글 수: 2
JFz
JFz 2018년 10월 16일
Thanks. I did. I wrote a function linest to take in one input dummyTable, but still get too many input arguments.
dpb
dpb 2018년 10월 16일
Can't debug what we can't see... :)

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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by