diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /331/CH8/EX8.28 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '331/CH8/EX8.28')
-rwxr-xr-x | 331/CH8/EX8.28/Example_8_28.sce | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/331/CH8/EX8.28/Example_8_28.sce b/331/CH8/EX8.28/Example_8_28.sce new file mode 100755 index 000000000..25ddb1eda --- /dev/null +++ b/331/CH8/EX8.28/Example_8_28.sce @@ -0,0 +1,37 @@ +//Caption:Two-tailed Test Concerning the Difference between Two Proportions
+//Example8.28
+//Page281
+
+clc;
+n1= 150; //sample size w.r.to City-Y
+n2 = 160; //sample size w.r.to City-X
+N1 = 135;//number of credit card holders in City-X
+N2 = 133;//number of creedit card holders in City-Y
+p1 = N1/n1; // proportion w.r.to City-X
+p2 = N2/n2; // proportion w.r.to City-Y
+Stdp1_p2 = sqrt(((p1*(1-p1))/n1)+((p2*(1-p2))/n2))
+alpha = 0.1;
+alpha = alpha/2;
+Zp1_p2 = ((p1-p2)-(0))/Stdp1_p2; //calculated normal statistic for (p1-p2)
+disp(Zp1_p2,'The calculated normal statistic for (p1-p2)=')
+z_Stand = standard_normal_zstat(alpha);//standard normal statistic for (p1-p2)
+disp(z_Stand,'The Standard normal statistic for (p1-p2)=')
+if ((-z_Stand < Zp1_p2) &(Zp1_p2 < z_Stand)) then
+ disp('It falls in the Acceptance Region')
+ disp('Then Null Hypothesis Ho should be Accepted')
+else
+ disp('It falls in the Rejection Region')
+ disp('Then Null Hypothesis Ho should be Rejected')
+end
+//Result
+//The calculated normal statistic for (p1-p2)=
+//
+// 1.7890614
+//
+// The Standard normal statistic for (p1-p2)=
+//
+// 1.64
+//
+// It falls in the Rejection Region
+//
+// Then Null Hypothesis Ho should be Rejected
\ No newline at end of file |