summaryrefslogtreecommitdiff
path: root/331/CH9/EX9.13/Example_9_13.sce
blob: ff37ab4769b7dacf40231048d20f124857d9e97a (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
//Caption: Two-Samples Tests
//Two-tailed two-samples sign test with binomial distribution
//Example9.13
//Page331
//Test  : Ho: uX = uY or p = 1/2
//        H1: uX # uY or p # 1/2
clear;
clc;
n = 8; //Number of observations of each sample
plus_signs = 6;
minus_signs = 2;
alpha = 0.05; //significance level
X = 5;//number of plus signs more than minus signs
p = 1/2;
q = 1-p;
[P,Q]=cdfbin("PQ",X,n,p,q);
disp(Q,'The binomial propability no. of plus signs > minus signs P(X>=6)=')
if (Q>alpha) then
    disp('Since P(Q>=6) is more than the significance level of 0.05')
    disp('It falls in the acceptance region and accpt Ho')
else
    disp('Reject Null Hypothesis Ho')
end
//Result
//The binomial propability no. of plus signs > minus signs P(X>=6)=   
// 
//    0.1445313  
// 
// Since P(Q>=6) is more than the significance level of 0.05   
// 
// It falls in the acceptance region and accpt Ho