diff options
Diffstat (limited to '331/CH10/EX10.3/Example_10_3.sce')
-rwxr-xr-x | 331/CH10/EX10.3/Example_10_3.sce | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/331/CH10/EX10.3/Example_10_3.sce b/331/CH10/EX10.3/Example_10_3.sce new file mode 100755 index 000000000..de461bd02 --- /dev/null +++ b/331/CH10/EX10.3/Example_10_3.sce @@ -0,0 +1,36 @@ +//Caption: Rank Correlation
+//Test of Significance of rank correlation coefficient
+//Example10.3
+//Page375
+X = [1,2,3,4,5,6,7,8,9,10];//rating by judge-1
+Y = [2,4,5,1,3,6,7,9,10,8];//rating by judge-2
+n = length(X);
+rs = 0;
+for i = 1:n
+ rs = rs+(X(i)-Y(i))^2;
+end
+rs = 1-6*(rs/(n*(n^2-1)));
+disp(rs,'The rank correlation coefficient is rs=');
+t = rs*sqrt((n-2)/(1-rs^2));
+disp(t,'The Calculated t statistic t=')
+t_stand = 2.306;
+disp(t_stand,'The table t value for 8 degrees of freedom and significance level = 0.025')
+if (t<t_stand) then
+ disp('Accept Null Hypothesis')
+else
+ disp('The caculated t statistic is > table t value, reject Null hypothesis')
+end
+//Result
+//The rank correlation coefficient is rs=
+//
+// 0.8303030
+//
+// The Calculated t statistic t=
+//
+// 4.2138888
+//
+// The table t value for 8 degrees of freedom and significance level = 0.025
+//
+// 2.306
+//
+// The caculated t statistic is > table t value, reject Null hypothesis
\ No newline at end of file |