衣服上有spearman是什么意思,什么时候用斯皮尔曼相关分析

计算使用JavaScript实现的Spearman相关系数的函数

‘ use strict ‘; var DEBUG=0; module.exports=function this.spearman=function ) x,y ) )/checkingparametersif ) undefined==typeof ) ) }ifundefined==typeofy ) ) { return; } var len_x=x.length; var len_y=y.length; var len=len_x len_y? len_x : len_y; iflen=0) { return; } var x_mean=0.0; var y_mean=0.0; forvarI=0; i len; I ) x_mean=parsefloatx[I]; y_mean=parsefloaty[I]; } x_mean=x_mean/len; y_mean=y_mean/len; var tmp_u=0.0; forvarI=0; i len; I ) {tmp_u=x_mean-x[I] ) ) * y_mean – y[i] ); /console.log’tmp_u=’,tmp_u ); var tmp_d_x=0.0; forvarI=0; i len; I ) {tmp_d_x=* x_mean – x[i] ) ) x_mean-x[I] ); } var tmp_d_y=0.0; forvarI=0; i len; I ) ) tmp_d_y=* y_mean – y[i] ) ) y_mean-y[I]; } var rho=tmp _ u/math.sqrt tmp _ d _ x * tmp _ d _ y ) if ) debug ) console.log ) report ‘ ) console.log consog console.log’meanvauleofy=’,y_mean ); console.logspearmancorofx-y=’,rho ); } return rho; }

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注