summaryrefslogtreecommitdiff
path: root/331/CH3/EX3.19/Example_3_19.sce
blob: afcd649a333f77e9a33c827e0d4de450db33d3e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//Cpation: Bowley's Measure of Skewness
//Example3.19
//Page63
clear;
clc;
X = [0,4;4,8;8,12;12,16;16,20;20,24;24,28;28,32];//Machine breakdown time (hrs)
f = [26,50,70,80,100,60,50,24]; //No. of machines
cum_f = cumsum(f);//cumulative frequencies
N = sum(f); //total frequency
C = diff(X(1,:)); //class interval
cen1 = N/4;
cen2 = N/2;
cen3 = 3*N/4;
for  i = 1:length(f)
    if ((cum_f(i)< cen1) &(cen1< cum_f(i+1))) then
        L1 = X(i+1,1);
        f1 = f(i+1);
        F1 = cum_f(i)
        C = diff(X(i+1,:));
    end
    if ((cum_f(i)< cen2) &(cen2< cum_f(i+1))) then
        L2 = X(i+1,1);
        f2 = f(i+1);
        F2 = cum_f(i)
    end
    if ((cum_f(i)< cen3) &(cen3< cum_f(i+1))) then
        L3 = X(i+1,1);
        f3 = f(i+1);
        F3 = cum_f(i)
        C = diff(X(i+1,:));
    end
end
disp(L1,'Lower limit of the first quartile class L1 =')
disp(f1,'Frequency of the first quartile class f1 =')
disp(F1,'Cumulative frequency of the previous class w.r.to the first quartile class F1=')
disp(C,'Width of the class interval C=')
Q1 = L1+(((N/4)-F1)*C/f1);
disp(Q1,'Fist Quartile Q1=')
disp(L2,'Lower limit of the second quartile class L2 =')
disp(f2,'Frequency of the second quartile class f2 =')
disp(F2,'Cumulative frequency of the previous class w.r.to the second quartile class F2=')
disp(C,'Width of the class interval C=')
Q2 = L2+(((N/2)-F2)*C/f2);
disp(Q2,'Fist Quartile Q1=')
disp(L3,'Lower limit of the third quartile class L3 =')
disp(f3,'Frequency of the third quartile class f3 =')
disp(F3,'Cumulative frequency of the previous class w.r.to the third quartile class F3=')
disp(C,'Width of the class interval C=')
Q3 = L3+(((3*N/4)-F3)*C/f3);
disp(Q3,'Third Quartile Q3=')
CS = (Q3+Q1-2*Q2)/(Q3-Q1)
disp(CS,'Bowleys coefficient of skewness CS=')
//Result
// 
// Lower limit of the first quartile class L1 =   
// 
//    8.  
// 
// Frequency of the first quartile class f1 =   
// 
//    70.  
// 
// Cumulative frequency of the previous class w.r.to the first quartile class F1=   
// 
//    76.  
// 
// Width of the class interval C=   
// 
//    4.  
// 
// Fist Quartile Q1=   
// 
//    10.228571  
// 
// Lower limit of the second quartile class L2 =   
// 
//    16.  
// 
// Frequency of the second quartile class f2 =   
// 
//    100.  
// 
// Cumulative frequency of the previous class w.r.to the second quartile class F2=   
// 
//    226.  
// 
// Width of the class interval C=   
// 
//    4.  
// 
// Fist Quartile Q1=   
// 
//    16.16  
// 
// Lower limit of the third quartile class L3 =   
// 
//    20.  
// 
// Frequency of the third quartile class f3 =   
// 
//    60.  
// 
// Cumulative frequency of the previous class w.r.to the third quartile class F3=   
// 
//    326.  
// 
// Width of the class interval C=   
// 
//    4.  
// 
// Third Quartile Q3=   
// 
//    21.266667  
// 
// Bowleys coefficient of skewness CS=   
// 
//  - 0.0747196