spearman correlation in bootstrap function

5 ビュー (過去 30 日間)
Tamir Eisenstein
Tamir Eisenstein 2019 年 3 月 11 日
コメント済み: Jeff Miller 2019 年 3 月 12 日
Hi Matlab experts,
How can I implement a spearman correlation in the bootstrp function:
bootstat = bootstrp(1000,@corr,a,b) ?
Thanks,
Tamir

回答 (1 件)

Jeff Miller
Jeff Miller 2019 年 3 月 11 日
scorr = @(a,b)(corr(a,b,'Spearman'));
bootstat = bootstrp(1000,scorr,a,b);
  2 件のコメント
Tamir Eisenstein
Tamir Eisenstein 2019 年 3 月 12 日
Hi Jeff,
Thanks! but it runs an error message when I try to run this code (I called the script "trial"):
Error using internal.stats.parseArgs (line 42)
Wrong number of arguments.
Error in corr (line 110)
[type,rows,tail] = internal.stats.parseArgs(pnames,dflts,varargin{:});
Error in trial>@(a,b)(corr(a,b,'Spearman'))
Error in bootstrp (line 170)
bootstat = feval(bootfun,bootargs{:});
Error in trial (line 2)
bootstat = bootstrp(1000,scorr,a,b);
Caused by:
Unable to evaluate BOOTFUN with the supplied arguments.
Jeff Miller
Jeff Miller 2019 年 3 月 12 日
Ooops, sorry, it should be
scorr = @(a,b)(corr(a,b,'type','Spearman'));

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by