diff options
Diffstat (limited to '291/CH11/EX11.2b/eg11_2b.sce')
-rwxr-xr-x | 291/CH11/EX11.2b/eg11_2b.sce | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/291/CH11/EX11.2b/eg11_2b.sce b/291/CH11/EX11.2b/eg11_2b.sce new file mode 100755 index 000000000..9511007fb --- /dev/null +++ b/291/CH11/EX11.2b/eg11_2b.sce @@ -0,0 +1,18 @@ +X = [3 6 9 7 5];
+p= [0.15 0.25 0.35 0.20 0.05];
+T= 0;
+n3=sum(X);
+np = p*n3;
+Xsqu = (X-np).^2;
+disp(Xsqu);
+XT = Xsqu./np;
+T = sum(XT);
+
+//T = T - sum(X);
+//disp("When there are 12 regions")
+disp(T, "The test statistic is")
+pvalue = 1- cdfchi("PQ",T(1), 4);
+//a= cdfchi("PQ",T(1), 4);
+
+disp(pvalue, "The pvalue is ")
+disp("Thus, the hypothesis would not be rejected at 5% level of significance")
\ No newline at end of file |