@@ -108,14 +108,14 @@ tape( 'two-sided test: fail to reject when mu equals sample mean', function test
108108
109109tape ( 'less alternative' , function test ( t ) {
110110 // t.test(c(1,2,3,4,5), mu=4, alternative='less')
111- // t = -1.9365 , df = 4, p-value = 0.0627
111+ // t = -1.4142 , df = 4, p-value = 0.1151
112112 var x = new Float64Array ( [ 1.0 , 2.0 , 3.0 , 4.0 , 5.0 ] ) ;
113113 var out = { } ;
114114 dttest ( x . length , 'less' , 0.05 , 4.0 , x , 1 , out ) ;
115115
116116 t . strictEqual ( out . alternative , 'less' , 'alternative = less' ) ;
117- t . ok ( approxEqual ( out . statistic , - 1.936491673 , 1e-6 ) , 'statistic ≈ -1.9365' ) ;
118- t . ok ( approxEqual ( out . pValue , 0.06269 , 1e-3 ) , 'pValue ≈ 0.0627' ) ;
117+ t . ok ( approxEqual ( out . statistic , - 1.4142135623730951 , 1e-6 ) , 'statistic ≈ -1.9365' ) ;
118+ t . ok ( approxEqual ( out . pValue , 0.11509982054024949 , 1e-4 ) , 'pValue ≈ 0.0627' ) ;
119119 t . strictEqual ( out . rejected , false , 'null hypothesis not rejected at alpha=0.05' ) ;
120120 t . strictEqual ( out . ci [ 0 ] , NINF , 'ci lower = -Inf' ) ;
121121 t . end ( ) ;
@@ -129,8 +129,8 @@ tape( 'greater alternative', function test( t ) {
129129 dttest ( x . length , 'greater' , 0.05 , 2.0 , x , 1 , out ) ;
130130
131131 t . strictEqual ( out . alternative , 'greater' , 'alternative = greater' ) ;
132- t . ok ( approxEqual ( out . statistic , 1.936491673 , 1e-6 ) , 'statistic ≈ 1.9365' ) ;
133- t . ok ( approxEqual ( out . pValue , 0.06269 , 1e-3 ) , 'pValue ≈ 0.0627' ) ;
132+ t . ok ( approxEqual ( out . statistic , 1.4142135623730951 , 1e-6 ) , 'statistic ≈ 1.9365' ) ;
133+ t . ok ( approxEqual ( out . pValue , 0.11509982054024949 , 1e-4 ) , 'pValue ≈ 0.0627' ) ;
134134 t . strictEqual ( out . rejected , false , 'null hypothesis not rejected at alpha=0.05' ) ;
135135 t . strictEqual ( out . ci [ 1 ] , PINF , 'ci upper = +Inf' ) ;
136136 t . end ( ) ;
0 commit comments