From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 331/CH8/EX8.28/Example_8_28.sce | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 331/CH8/EX8.28/Example_8_28.sce (limited to '331/CH8/EX8.28/Example_8_28.sce') 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 -- cgit