summaryrefslogtreecommitdiff
path: root/291/CH10/EX10.5a
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /291/CH10/EX10.5a
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '291/CH10/EX10.5a')
-rwxr-xr-x291/CH10/EX10.5a/eg10_5a.sce40
1 files changed, 40 insertions, 0 deletions
diff --git a/291/CH10/EX10.5a/eg10_5a.sce b/291/CH10/EX10.5a/eg10_5a.sce
new file mode 100755
index 000000000..b0a9fc100
--- /dev/null
+++ b/291/CH10/EX10.5a/eg10_5a.sce
@@ -0,0 +1,40 @@
+X = [53 35 31 37 40 43; 36 34 17 21 30 18; 47 37 17 31 45 26; 55 31 17 23 43 37; 40 32 19 26 45 37; 52 42 20 27 26 32; 39 28 21 21 36 28; 40 32 21 21 36 35];
+m= 8;
+n = 6;
+Xidot = zeros(8,1);
+for i=1:8
+ for j=1:6
+ Xidot(i)=Xidot(i) + X(i,j);
+ end
+end
+Xidot = Xidot/6;
+Xjdot = zeros(6,1);
+for j=1:6
+ for i=1:8
+ Xjdot(j)=Xjdot(j) + X(i,j);
+ end
+end
+Xjdot = Xjdot/8;
+Xdotdot = sum(Xidot)/8;
+new = (Xidot - Xdotdot)^2;
+SSr = n*sum(new);
+new1 = (Xjdot - Xdotdot)^2;
+SSc = m*sum(new1);
+SSe = 0;
+for i=1:m
+ for j=1:n
+ SSe = SSe + (X(i,j)-Xidot(i)-Xjdot(j)+ Xdotdot)^2;
+ end
+end
+N =(m-1)*(n-1);
+TS1 = SSr*N/((m-1)*SSe);
+TS2 = SSc*N/((n-1)*SSe);
+pvaluec = 1- cdff("PQ", TS1, m-1, N);
+pvaluer = 1- cdff("PQ", TS2, n-1, N);
+//disp(pvaluer, pvaluec);
+//disp(TS1, TS2);
+disp(TS1, "The value of the F-statistic for testing that there is no row effect is");
+disp(pvaluec, "The p-value for testing that there is no row effect is");
+
+disp(TS2, "The value of the F-statistic for testing that there is no column effect is");
+disp(pvaluer, "The p-value for testing that there is no column effect is");