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/CH4/EX4.2/Example_4_2.sce | 102 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 331/CH4/EX4.2/Example_4_2.sce (limited to '331/CH4/EX4.2') diff --git a/331/CH4/EX4.2/Example_4_2.sce b/331/CH4/EX4.2/Example_4_2.sce new file mode 100755 index 000000000..ccc9f22eb --- /dev/null +++ b/331/CH4/EX4.2/Example_4_2.sce @@ -0,0 +1,102 @@ +//Caption: Completely Randomized Design +//Example4.2 +//Page78 +clear; +clc; +Yij = [80,70,65,90;90,60,50,89;96,55,58,85;85,85,55,95;70,90,40,80]; +disp(Yij,'Yij=') +[m,n] = size(Yij); +Y = sum(Yij(:,:)); +disp(Y,'Y=') +Y1 = sum(Yij(:,1)); +disp(Y1,'Y1=') +Y2 = sum(Yij(:,2)); +disp(Y2,'Y2=') +Y3 = sum(Yij(:,3)); +disp(Y3,'Y3=') +Y4 = sum(Yij(:,4)); +disp(Y4,'Y4=') +SS_total = sum(Yij(:,:).^2)-(Y^2)/(m*n); +disp(SS_total,'SS_total=') +SS_treatments = ((Y1^2)/m)+((Y2^2)/m)+((Y3^2)/m)+((Y4^2)/m)-(Y^2)/(m*n); +disp(SS_treatments,'SS_treatments=') +SS_error = SS_total-SS_treatments; +disp(SS_error,'SS_error=') +Bet_Treat_DOF = n-1; +disp(Bet_Treat_DOF,'Degrees of freedom Between treatments=') +Within_Treat_DOF = m*n-n; +disp(Within_Treat_DOF,'Degrees of freedom With in treatments=') +MSS = [SS_treatments/Bet_Treat_DOF,SS_error/Within_Treat_DOF]; +disp(MSS,'Mean Sum of Squares ='); +F_ratio = MSS(1)/MSS(2); +disp(F_ratio,'Calculated F ratio =') +Ftable = 3.24; +disp(Ftable,'Tablw F ratio for the significance level =0.05 7 degrees of freedom (3,16)=') +if (F_ratio