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.19/Example_8_19.sce | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 331/CH8/EX8.19/Example_8_19.sce (limited to '331/CH8/EX8.19') diff --git a/331/CH8/EX8.19/Example_8_19.sce b/331/CH8/EX8.19/Example_8_19.sce new file mode 100755 index 000000000..d3eb93d59 --- /dev/null +++ b/331/CH8/EX8.19/Example_8_19.sce @@ -0,0 +1,58 @@ +//One-tailed Tests Concerning Difference between Two Means +//(When the variances of the Populations are UnKnown and the Sample Sizes are Large) +//Example8.19 +//page262 +//Test 1 : Ho:u1<=u2 or u1-u2<=0 +// H1: u1>u2 or u1-u2>0 +clc; +Sigma1 = input('Enter the variance of population1') +Sigma2 = input('Enter the varinace of population2') +n1 = input('Enter the sample size taken from population1') +n2 = input('Enter the sample size taken from population2') +X1 = input('Enter the mean of the sample1') +X2 = input('Enter the mean of the sample2') +alpha = input('Enter the significance level') +Test = input('Enter the Type of test') +//Calculation of Z statistic +Z_X1_X2 = Norm_Dis_Diff_Two_Mean(X1,X2,Sigma1,Sigma2,n1,n2) +disp(Z_X1_X2,'calculated Normal Z-statistic =') +Z_alpha = standard_normal_zstat(alpha) +disp(Z_alpha,'Standard Normal Stastistic=') +if (Test==1) then + if(Z_X1_X2 < Z_alpha) then + disp('It falls in the Acceptance Region') + disp('Then Null Hypothesis Ho should be Accepted') + elseif(Z_X1_X2 > Z_alpha) then + disp('It falls in the Rejection Region') + disp('Then Null Hypothesis Ho should be Rejected') + end +elseif (Test==2) then + if(Z_X1_X2 >-Z_alpha) + disp('It falls in the Acceptance Region') + disp('Then Null Hypothesis Ho should be Accepted') + elseif(Z_X1_X2<-Z_alpha) + disp('It falls in the Rejection Region') + disp('Then Null Hypothesis Ho should be Rejected') + end +end +//Result +//Enter the variance of population1 9 +//Enter the varinace of population2 25 +//Enter the sample size taken from population1 81 +//Enter the sample size taken from population2 64 +//Enter the mean of the sample1 70 +//Enter the mean of the sample2 68 +//Enter the significance level 0.05 +//Enter the Type of test 1 +// +//calculated Normal Z-statistic = +// +// 2.8235294 +// +//Standard Normal Stastistic= +// +// 1.64 +// +//It falls in the Rejection Region +// +//Then Null Hypothesis Ho should be Rejected \ No newline at end of file -- cgit