From c4126434743a6f01cee4e2468ad889d3cdaa75a2 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 25 Apr 2022 13:36:08 +0300 Subject: compute p val for spearman --- src/lib.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index f78fc0f..378bd33 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,16 @@ impl Spearman { impl Correlation for Spearman { fn correlate(&self,x:&[f64],y:&[f64]) -> (f64,f64){ - (1.2,2.1) + + //dditional workspace of size 2*n is required in work + let mut vec = Vec::with_capacity(2 * self.n); + let workspace: &mut [f64] = vec.as_mut_slice(); + let rho = spearman(x, 1, y, 1, self.n, workspace); + + //p-val two sided + + let p_val = + return (rho,2.1); } } -- cgit 1.4.1