# Estimation of Log-Linear-Binomial  Distribution with Applications

Authors: Elsayed Ali Habib
Journal: Journal of Probability and Statistics
 (2010)

---

## Abstract

Log-linear-binomial distribution was introduced  for describing the behavior of the sum of dependent Bernoulli random variables. The distribution is a generalization of binomial distribution that allows construction of a broad class of distributions. In this paper, we consider the problem of estimating the two parameters of log-linearbinomial distribution by moment and maximum likelihood methods. The distribution is used to fit genetic data and to obtain the sampling distribution of the sign test under dependence among trials.


---

## Body

## 1. Introduction

During  the last three decades, a growing amount of literature has been observed in generalizing the classical discrete distributions. The  main idea was to apply the extended versions of modeling different kinds of dependent count or frequency structure in various fields; see the work of  Johnson et al. in [1], and of Bowman and George in [2], and of George and Bowman in [3],  Yu and Zelterman [4, 5]. Failure to take account of correlation  in the data will cause less precision for binomial-based estimates; see, for example,  Kolev and Paiva [6].As a generalization for the binomial distribution, Lovison [7] has derived the distribution of the sum of dependent Bernoulli random variables as an alternative of Altham's multiplicative-binomial distribution [8] from Cox's log-linear representation [9] for the joint distribution of n binary-dependent responses and it will be called log-linear-binomial distribution. This distribution is characterized by two parameters and provides wider range of distributions than are provided by the binomial distribution where the log-linear binomial distribution  includes underdispersion, overdispersion models and the binomial distribution as a special case.In this paper, the methods of moment and maximum likelihood are used to estimate the two parameters of Lovison's log-linear binomial distribution. The variance-covariance matrix for the estimated parameters is obtained. Log-linear binomial distribution is also used to fit genetic data, and to obtain the sampling distribution of the sign test under dependence among trials.In Section2, we define Lovison's log-linear binomial distribution. Estimation of the parameters of the distribution based on moments and maximum likelihood methods are derived in Section 3. Ungrouped data is studied in Section 4 as a special case. Two applications are given in Section 5.


## 2. Lovison's Log-Linear-Binomial Distribution

Consider the random vectorZ=[Z1,…,Zn]′, Zi being a binary response which measures whether some event of interest is present, “1”, or absent, “0” for a sample of n units and Yn=∑i=1nZi denotes the sample frequency of successes. To accommodate the possible dependence among Zi, and under the assumption that the units are exchangeable Lovison [7] has obtained the distribution of Yn as
(2.1)P(Yn=y)=(ny)ψy(1-ψ)n-yωy(n-y)∑t=0n(nt)ψt(1-ψ)n-tωt(n-t),y=0,1,…,n,
where 0<ψ<1 and ω>0 are the parameters; for more details about this distribution; see the work of Lovison in [7]. This distribution provides a wider range of distributions than is provided by the binomial distribution, for example, Figures 1 and 2 show the distribution of Yn for n=10, ψ=0.2,0.5, and different values of ω. For the values of ω>1, the distribution is sharper in the middle than the binomial.The distribution ofYn for different values of ω, ψ=0.2, and n=10.
(a)(b)(c)(d)The distribution ofYn for different values of ω, ψ=0.5, and n=10.
(a)(b)(c)(d)As can be seen from the figures for some values ofω<1, the distribution can be U, bimodal and unimodal shapes. The expected value and the variance of Yn are given by(2.2)μ=E(Yn)=nπ,σ2=V(Yn)=nπ(1-π)+n(n-1)(π1-π2).
Note that
(2.3)V(Yn)=V(Yb)+n(n-1)Cov(Zk,Zh)
for k≠h and Cov stands for covariance. The variance of the binomial is
(2.4)V(Yb)=nπ(1-π),
and the covariance of Zk and Zh is
(2.5)Cov(Zk,Zh)=π1-π2,
where
(2.6)π=ψκn-1(ψ,ω)κn(ψ,ω),π1=ψ2κn-2(ψ,ω)κn(ψ,ω).
Therefore, the variance of the log-linear binomial is equal to the variance of binomial when Cov(Zk,Zh)=0, greater than the variance of binomial when Cov(Zk,Zh)>0, and less than the variance of binomial when Cov(Zk,Zh)<0.The  expected value and the variance ofYn are nonlinear on both ψ and ω. For example, the nonlinearity in the variance of Yn is depicted in Figures 3 and 4.Variance ofYn for various values of ω at each value of ψ and n=25.
(a)(b)(c)(d)Variance ofYn for various values of ω at each value of ψ and n=25.
(a)(b)(c)(d)


## 3. Estimation of the Parameters

Let a random sample ofR sets of n trials each be available, the number of given y successes being fy(y=0,1,2,…,n), and R=∑y=0nfy.


### 3.1. Method of Moments

We can use the first two sample moments to find moment estimates forψ and ω as follows. The first sample moment is (3.1)m1=∑y=0nyfyR,M2=∑y=0nfr(y-m1)2R.
Equating these sample moments to the corresponding population moments we obtain the estimates of ψ and ω by solving the two equations(3.2)m1=nψκn-1(ψ,ω)κn(ψ,ω),M2=n(n-1)ψ2κn-2(ψ,ω)κn(ψ,ω)+nψκn-1(ψ,ω)κn(ψ,ω)-n2ψ2[κn-1(ψ,ω)κn(ψ,ω)]2.
The solution of these two equations needs numerical methods. The numerical solution of these two equations may be found by using nonlinear equation solver (nleqslv) in statistical R-software. The author has a program written in R for finding the moment estimates upon request.


### 3.2. Method of Maximum Likelihood

The method of maximum likelihood provides estimators that have a reasonable intuitive basis and many desirable statistical properties. The likelihood of the sample can be written as(3.3)L(ψ,ω∣n,y,f)=R!∏y=0n[P(y;ψ,ω)]fyfy!.
Take the logarithm of this function(3.4)l=log⁡R!+∑y=0nfylog⁡P(y;ψ,ω)-∑y=0nlogfy!
The first partial derivatives with respect to ψ and ω are (3.5)∂l∂ψ=∑y=0nfy(∂/∂ψ)P(y;ψ,ω)P(y;ψ,ω),∂l∂ω=∑y=0nfy(∂/∂ω)P(y;ψ,ω)P(y;ψ,ω).
Let
(3.6)q0=(ny)ψy(1-ψ)(n-y)ωy(n-y),q1=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t).
Hence,(3.7)P(y;ψ,ω)=q0q1.


#### 3.2.1. Estimation ofψ and ω

After simplification the first partial derivative forψ and ω can be written as (3.8)∂l∂ψ=∑y=0nyfyψ-∑y=0n(n-y)fy1-ψ-Rq1ψ′q1,∂l∂ω=∑y=0ny(n-y)fyω-q1ω′Rq1.
where (3.9)q1ψ′=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t)[tψ-n-t1-ψ],q1ω′=∑t=0n(nt)t(n-t)ψt(1-ψ)(n-t)ωt(n-t)-1.
By solving ∂l/∂ψ=0 and ∂l/∂ω=0 simultaneously we obtain the maximum likelihood estimates ψ̂ml and ω̂ml under the sufficient condition ∂2l/∂ψ2<0 and ∂2l/∂ω2<0.The numerical solution for these two equations may be obtained using nonlinear equation solver (nleqslv) in R-software. The author has a program written in R for finding the maximum likelihood estimates upon request.


#### 3.2.2. The Asymptotic Variances

Suppose thatθ=[ψω]′ and under certain regularity conditions the information matrix is(3.10)Iij(θ)=-E[∂2∂θi∂θjlog⁡L(θ)].
The asymptotic variance-covariance matrix  can be obtained as
(3.11)V(θ̂)≈[Iij(θ)]-1.
To find the information matrix for the log-linear binomial distribution, we note that (3.12)∂2l∂ψ2=-∑y=0nyfyψ2-∑y=0n(n-y)fy(1-ψ)2-[q1q1ψ′′R-q1ψ′2Rq12],∂2l∂ω2=-∑y=0ny(n-y)fyω2-[q1q1ω′′R-q1ω′2Rq12],∂∂ψ∂l∂ω=-Rq1q1ω.ψ′′-Rq1ω′q1ψ′q12,
where
(3.13)q1ψ′′=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t)[t(t-1)ψ2-2t(n-t)ψ(1-ψ)+(n-t)(n-t-1)(1-ψ)2],q1ω′′=∑t=0n(nt)t(n-t)[t(n-t)-1]ψt(1-ψ)(n-t)ωt(n-t)-2,q1ω⋅ψ′′=∑t=0n(nt)t(n-t)ψt(1-ψ)(n-t)ωt(n-t)-1[tψ-n-t1-ψ].
Taking the expectation,  the information matrix is obtained as (3.14)I(θ)=[Rμψ2+R(n-μ)(1-ψ)2+[q1q1ψ′′R-q1ψ′2Rq12]Rq1q1ω⋅ψ′′-Rq1ω′q1ψ′q12Rq1q1ω⋅ψ′′-Rq1ω′q1ψ′q12R[μ(n-μ)-σ2]ω2+[q1q1ω′′R-q1ω′2Rq12]],
where E[∑y=0ny(n-y)fy]=nE(∑y=0nyfy)-E(∑y=0ny2fy)=nRμ-R(μ2+σ2). The variance-covariance matrix will be
(3.15)V(θ̂)≈[I(θ)]-1.
The estimated variance-covariance matrix is
(3.16)V̂(θ̂)≈[I(θ̂)]-1.
The author has a program written in R for finding the estimated variance-covariance matrix upon request.


## 3.1. Method of Moments

We can use the first two sample moments to find moment estimates forψ and ω as follows. The first sample moment is (3.1)m1=∑y=0nyfyR,M2=∑y=0nfr(y-m1)2R.
Equating these sample moments to the corresponding population moments we obtain the estimates of ψ and ω by solving the two equations(3.2)m1=nψκn-1(ψ,ω)κn(ψ,ω),M2=n(n-1)ψ2κn-2(ψ,ω)κn(ψ,ω)+nψκn-1(ψ,ω)κn(ψ,ω)-n2ψ2[κn-1(ψ,ω)κn(ψ,ω)]2.
The solution of these two equations needs numerical methods. The numerical solution of these two equations may be found by using nonlinear equation solver (nleqslv) in statistical R-software. The author has a program written in R for finding the moment estimates upon request.


## 3.2. Method of Maximum Likelihood

The method of maximum likelihood provides estimators that have a reasonable intuitive basis and many desirable statistical properties. The likelihood of the sample can be written as(3.3)L(ψ,ω∣n,y,f)=R!∏y=0n[P(y;ψ,ω)]fyfy!.
Take the logarithm of this function(3.4)l=log⁡R!+∑y=0nfylog⁡P(y;ψ,ω)-∑y=0nlogfy!
The first partial derivatives with respect to ψ and ω are (3.5)∂l∂ψ=∑y=0nfy(∂/∂ψ)P(y;ψ,ω)P(y;ψ,ω),∂l∂ω=∑y=0nfy(∂/∂ω)P(y;ψ,ω)P(y;ψ,ω).
Let
(3.6)q0=(ny)ψy(1-ψ)(n-y)ωy(n-y),q1=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t).
Hence,(3.7)P(y;ψ,ω)=q0q1.


### 3.2.1. Estimation ofψ and ω

After simplification the first partial derivative forψ and ω can be written as (3.8)∂l∂ψ=∑y=0nyfyψ-∑y=0n(n-y)fy1-ψ-Rq1ψ′q1,∂l∂ω=∑y=0ny(n-y)fyω-q1ω′Rq1.
where (3.9)q1ψ′=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t)[tψ-n-t1-ψ],q1ω′=∑t=0n(nt)t(n-t)ψt(1-ψ)(n-t)ωt(n-t)-1.
By solving ∂l/∂ψ=0 and ∂l/∂ω=0 simultaneously we obtain the maximum likelihood estimates ψ̂ml and ω̂ml under the sufficient condition ∂2l/∂ψ2<0 and ∂2l/∂ω2<0.The numerical solution for these two equations may be obtained using nonlinear equation solver (nleqslv) in R-software. The author has a program written in R for finding the maximum likelihood estimates upon request.


### 3.2.2. The Asymptotic Variances

Suppose thatθ=[ψω]′ and under certain regularity conditions the information matrix is(3.10)Iij(θ)=-E[∂2∂θi∂θjlog⁡L(θ)].
The asymptotic variance-covariance matrix  can be obtained as
(3.11)V(θ̂)≈[Iij(θ)]-1.
To find the information matrix for the log-linear binomial distribution, we note that (3.12)∂2l∂ψ2=-∑y=0nyfyψ2-∑y=0n(n-y)fy(1-ψ)2-[q1q1ψ′′R-q1ψ′2Rq12],∂2l∂ω2=-∑y=0ny(n-y)fyω2-[q1q1ω′′R-q1ω′2Rq12],∂∂ψ∂l∂ω=-Rq1q1ω.ψ′′-Rq1ω′q1ψ′q12,
where
(3.13)q1ψ′′=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t)[t(t-1)ψ2-2t(n-t)ψ(1-ψ)+(n-t)(n-t-1)(1-ψ)2],q1ω′′=∑t=0n(nt)t(n-t)[t(n-t)-1]ψt(1-ψ)(n-t)ωt(n-t)-2,q1ω⋅ψ′′=∑t=0n(nt)t(n-t)ψt(1-ψ)(n-t)ωt(n-t)-1[tψ-n-t1-ψ].
Taking the expectation,  the information matrix is obtained as (3.14)I(θ)=[Rμψ2+R(n-μ)(1-ψ)2+[q1q1ψ′′R-q1ψ′2Rq12]Rq1q1ω⋅ψ′′-Rq1ω′q1ψ′q12Rq1q1ω⋅ψ′′-Rq1ω′q1ψ′q12R[μ(n-μ)-σ2]ω2+[q1q1ω′′R-q1ω′2Rq12]],
where E[∑y=0ny(n-y)fy]=nE(∑y=0nyfy)-E(∑y=0ny2fy)=nRμ-R(μ2+σ2). The variance-covariance matrix will be
(3.15)V(θ̂)≈[I(θ)]-1.
The estimated variance-covariance matrix is
(3.16)V̂(θ̂)≈[I(θ̂)]-1.
The author has a program written in R for finding the estimated variance-covariance matrix upon request.


## 3.2.1. Estimation ofψ and ω

After simplification the first partial derivative forψ and ω can be written as (3.8)∂l∂ψ=∑y=0nyfyψ-∑y=0n(n-y)fy1-ψ-Rq1ψ′q1,∂l∂ω=∑y=0ny(n-y)fyω-q1ω′Rq1.
where (3.9)q1ψ′=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t)[tψ-n-t1-ψ],q1ω′=∑t=0n(nt)t(n-t)ψt(1-ψ)(n-t)ωt(n-t)-1.
By solving ∂l/∂ψ=0 and ∂l/∂ω=0 simultaneously we obtain the maximum likelihood estimates ψ̂ml and ω̂ml under the sufficient condition ∂2l/∂ψ2<0 and ∂2l/∂ω2<0.The numerical solution for these two equations may be obtained using nonlinear equation solver (nleqslv) in R-software. The author has a program written in R for finding the maximum likelihood estimates upon request.


## 3.2.2. The Asymptotic Variances

Suppose thatθ=[ψω]′ and under certain regularity conditions the information matrix is(3.10)Iij(θ)=-E[∂2∂θi∂θjlog⁡L(θ)].
The asymptotic variance-covariance matrix  can be obtained as
(3.11)V(θ̂)≈[Iij(θ)]-1.
To find the information matrix for the log-linear binomial distribution, we note that (3.12)∂2l∂ψ2=-∑y=0nyfyψ2-∑y=0n(n-y)fy(1-ψ)2-[q1q1ψ′′R-q1ψ′2Rq12],∂2l∂ω2=-∑y=0ny(n-y)fyω2-[q1q1ω′′R-q1ω′2Rq12],∂∂ψ∂l∂ω=-Rq1q1ω.ψ′′-Rq1ω′q1ψ′q12,
where
(3.13)q1ψ′′=∑t=0n(nt)ψt(1-ψ)(n-t)ωt(n-t)[t(t-1)ψ2-2t(n-t)ψ(1-ψ)+(n-t)(n-t-1)(1-ψ)2],q1ω′′=∑t=0n(nt)t(n-t)[t(n-t)-1]ψt(1-ψ)(n-t)ωt(n-t)-2,q1ω⋅ψ′′=∑t=0n(nt)t(n-t)ψt(1-ψ)(n-t)ωt(n-t)-1[tψ-n-t1-ψ].
Taking the expectation,  the information matrix is obtained as (3.14)I(θ)=[Rμψ2+R(n-μ)(1-ψ)2+[q1q1ψ′′R-q1ψ′2Rq12]Rq1q1ω⋅ψ′′-Rq1ω′q1ψ′q12Rq1q1ω⋅ψ′′-Rq1ω′q1ψ′q12R[μ(n-μ)-σ2]ω2+[q1q1ω′′R-q1ω′2Rq12]],
where E[∑y=0ny(n-y)fy]=nE(∑y=0nyfy)-E(∑y=0ny2fy)=nRμ-R(μ2+σ2). The variance-covariance matrix will be
(3.15)V(θ̂)≈[I(θ)]-1.
The estimated variance-covariance matrix is
(3.16)V̂(θ̂)≈[I(θ̂)]-1.
The author has a program written in R for finding the estimated variance-covariance matrix upon request.


## 4. Special Case: Ungrouped Data

If the values of Bernoulli random variablesZi are known, the parameters ψ and ω can be estimated as follows. By noticing that in a vector of binary responses z there are n(n-1)/2 pairs of responses, and if the order is irrelevant three types of pairs are distinguishable: (n-y)(n-y-1)/2 pairs of (zk=0,zh=0), y(y-1)/2 pairs of (zk=1,zh=1), and (n-y)y pairs of (zk=0,zh=1), or (zk=1,zh=0)where y=∑k=1nzk; see the work of Lovison in [7]. Therefore, the estimate of ω is
(4.1)ω̂=1CPR̂.
The estimated cross-product ratio (CPR) is
(4.2)CPR̂=0.25y(y-1)(n-y)(n-y-1)#(zk=0,zh=1)#(zk=1,zh=0).
To obtain the maximum likelihood estimate of ψ, we need to solve
(4.3)dldψ=yψ-(n-y)1-ψ-q1ψ′q1=0.
The estimated variance of ψ̂ can be obtained when R=1.


## 5. Applications

### 5.1. Sampling Distribution of the Sign Test for Comparing Paired Sample

The sign test is a nonparametric test which makes very few assumptions about the nature of the distributions under test. It is for use with two repeated (or correlated) measures, and measurement is assumed to be at least ordinal. The usual null hypothesis for this test is that there is no difference between the two treatments (groups,gk, k=1,2). Formally, let τ=P(X>Y), and then test the null hypothesis  H0: τ=0.5 for no differences against H1: π≠0.5 for differences. The sign test can be written as
(5.1)sd=∑i=1nI(g1i-g2i)=∑i=1nZi=Yn,
where
(5.2)Zi={1,g1i-g2i>0(+),0,xg1i-g2i<0(-).
Under the assumptions of two outcomes, fixed probability of success, and independent trials it is assumed that the sampling distribution of sd is binomial distribution. The rejection region is
(5.3)Pvalue=P(rejectH0∣H0istrue,n,yd)=∑j=0yd(nj)0.5n
and  yd=min(#1,#0). For a two-tailed test we reject H0 if 2Pvalue≤α,  else we do not reject H0, where α is prespecified  value.


#### 5.1.1. Sign Test Under Dependence of the Trials

Suppose the assumption of mutual independence in the data is violated and the trails are dependent; see, for example, the work of Tallis in [10] and Luceño [11]. In this case, we suggest the log-linear binomial distribution as a sampling distribution of sd=∑i=1nZi rather than the binomial distribution. Let τ=P(X>Y)=P(Z=1)=ψ(κn-1(ψ,ω)/κn(ψ,ω)) represent the probability of success. Then the null hypothesis H0: τ=0.5 is equivalent to H0: ψ=0.5. Therefore, under the null hypothesis, the rejection region can be obtained as
(5.4)Pvalue⋅lb=P(rejectH0∣H0istrue,n,yd,ω)=∑j=0yd(nj)0.5nωj(n-j)∑t=0n(nt)0.5nωt(n-t),
where yd=min(#1,#0) and ω=1/CPR. For a two-tailed test,  we reject H0 if 2Pvalue.lb≤α, else do not reject H0 and α is a prespecified value (H0: there is no difference  against  H1: there is difference.)Example 5.1.
A physiologist wants to know if monkeys prefer stimulation of brain area A to stimulation of brain area B. In the experiment, 14 rhesus monkeys from the same family are taught to press two bars. When a light comes on, presses on Bar 1 result in stimulation of area A and presses on Bar 2 result in stimulation of area B. After learning to press the bars, the monkeys are tested for 15 minutes, during which time the frequencies for the two bars are recorded. The data are shown in Table1.
Using the binomial distribution, we haven=14, yd=3, and Pvalue is(5.5)2Pvalue=∑j=03(14j)0.514=2×0.0287=0.0574.
Since 0.0574>0.05, we do not reject H0.
Using the log-linear binomial distribution, we haven=14, yd=3, and(5.6)ω=1(55)(3)/(25)(8)=1.1,
and the Pvalue is
(5.7)2Pvalue.lb=∑j=03(14j)0.5141.1j(14-j)∑t=014(14t)0.5141.1t(14-t)=2(0.00687)=0.0137,
where 0.0137<0.05, so we reject H0. That is, we would conclude that monkeys prefer stimulation in brain area B to stimulation in area A. Note that the rejection of H0 agrees with Wilcoxon Signed-Ranks test for the same data; see the work of Weaver in [12] and Siegel and Castellan in  [13].Table 1
Number of bar presses in brain stimulation experiment.
Subjectbar 1bar 2DifferenceZi (sign)12040−200(-)21825−70(-)32438−140(-)41427−130(-)5531−260(-)6262151(+)71532−170(-)82938−90(-)91525−100(-)10918−90(-)112532−70(-)12312831(+)13353321(+)141229−170(-)The data are obtained from Weaver [12].Power of the Test
Following the method given by Groebner et al. in [14], we may use the normal approximation to study the power of the sign test at n=14, ω=1.1 and using one-tail test for simplicity as follows. The power of the test is
(5.8)power=1-β,β=P(acceptH0∣H0isfalse).
For one-tailed test H0: τ≤0.5 and H1: τ>0.5 using binomial distribution with n=14, τ=0.5 and σ=14(0.5)(0.5)=1.8708. The critical value with α=0.05 is
(5.9)y0.05,b=14(0.5)+1.645(1.8708)=10.077.
The  power of the test is
(5.10)powerb≈1-P(Z<10.077-14τ11.8708),
for τ1>0.5.
Using log-linear binomial distribution withn=14, ψ=0.5, and ω=1.1, we obtain σ=1.4616, then under H0 and α=0.05, the critical value is(5.11)y0.05,lb=14(0.5)+1.645(1.4616)=9.404.
The power of the test under log-linear binomial distribution is
(5.12)powerlb≈1-P(Z<9.404-14τ11.4616),τ1>0.5.
Power of the sign test is given in Table2. In this case, the log-linear binomial distribution shows improvement in the power of the sign test over the sign test under binomial; for example, when τ1=0.70, the power increases from 0.44 to 0.61 about 1.40 times.Table 2
Power of the sign test under binomial and log-linear binomial distribution for one-tail test withn=14, ω=1.1, and α=0.05 based on normal approximation.
τ10.50.600.700.800.900.95Binomial distributionZ1.640.890.15−0.60−1.35−1.72Power0.050.180.440.730.910.96Log-linear binomial distributionZ1.640.68−0.27−1.23−2.18−2.66Power0.050.250.610.890.980.996


### 5.2. Fitting Genetic Data

The data are taken from Salmaniyaa hospital records in Bahrain for a genetic study on the gender ratio. Table3 shows the number of male children in 3475 families with 7 children.Table 3
Numbers of male children in 3475 families of size 7
MaleFamiliesBinomialLog-linear binomial01555.8017.531200314.22203.202778758.24769.21312401016.511233.024897817.65903.935295394.62303.07645105.81432.02}7512.16Total347534753475Chi-square193.011.374Note: frequencies marked with bracket were combined for purpose of calculatingχ2The first two sample moments are(5.13)m1=3.12057,M2=1.21567.
If we use binomial distribution, the estimated value of τ from the sample is
(5.14)τ̂=3.120577=0.4458.
This value of τ̂ was used to obtain the expected frequencies shown in Table 3. The value of χ2=193.01 with 7 degrees of freedom givesp=0<0.05, the simple binomial model has to be rejected. If we use log-linear binomial distribution, and fit the data by maximum likelihood, we find that
(5.15)ψ̂=0.423,ω̂=1.14543.
The estimated variance-covariance matrix is
(5.16)V̂(θ̂)≈[70974.89107162510716.258927.83]-1=[0.000017-.000021-.0000210.000137].
The expected frequencies based on these estimates are shown in Table 3. The value of χ2=1.288 with 6 degrees of freedom givesp=0.97>0.05. Thus, the log-linear binomial distribution provides a good fit to the observed data.


## 5.1. Sampling Distribution of the Sign Test for Comparing Paired Sample

The sign test is a nonparametric test which makes very few assumptions about the nature of the distributions under test. It is for use with two repeated (or correlated) measures, and measurement is assumed to be at least ordinal. The usual null hypothesis for this test is that there is no difference between the two treatments (groups,gk, k=1,2). Formally, let τ=P(X>Y), and then test the null hypothesis  H0: τ=0.5 for no differences against H1: π≠0.5 for differences. The sign test can be written as
(5.1)sd=∑i=1nI(g1i-g2i)=∑i=1nZi=Yn,
where
(5.2)Zi={1,g1i-g2i>0(+),0,xg1i-g2i<0(-).
Under the assumptions of two outcomes, fixed probability of success, and independent trials it is assumed that the sampling distribution of sd is binomial distribution. The rejection region is
(5.3)Pvalue=P(rejectH0∣H0istrue,n,yd)=∑j=0yd(nj)0.5n
and  yd=min(#1,#0). For a two-tailed test we reject H0 if 2Pvalue≤α,  else we do not reject H0, where α is prespecified  value.


### 5.1.1. Sign Test Under Dependence of the Trials

Suppose the assumption of mutual independence in the data is violated and the trails are dependent; see, for example, the work of Tallis in [10] and Luceño [11]. In this case, we suggest the log-linear binomial distribution as a sampling distribution of sd=∑i=1nZi rather than the binomial distribution. Let τ=P(X>Y)=P(Z=1)=ψ(κn-1(ψ,ω)/κn(ψ,ω)) represent the probability of success. Then the null hypothesis H0: τ=0.5 is equivalent to H0: ψ=0.5. Therefore, under the null hypothesis, the rejection region can be obtained as
(5.4)Pvalue⋅lb=P(rejectH0∣H0istrue,n,yd,ω)=∑j=0yd(nj)0.5nωj(n-j)∑t=0n(nt)0.5nωt(n-t),
where yd=min(#1,#0) and ω=1/CPR. For a two-tailed test,  we reject H0 if 2Pvalue.lb≤α, else do not reject H0 and α is a prespecified value (H0: there is no difference  against  H1: there is difference.)Example 5.1.
A physiologist wants to know if monkeys prefer stimulation of brain area A to stimulation of brain area B. In the experiment, 14 rhesus monkeys from the same family are taught to press two bars. When a light comes on, presses on Bar 1 result in stimulation of area A and presses on Bar 2 result in stimulation of area B. After learning to press the bars, the monkeys are tested for 15 minutes, during which time the frequencies for the two bars are recorded. The data are shown in Table1.
Using the binomial distribution, we haven=14, yd=3, and Pvalue is(5.5)2Pvalue=∑j=03(14j)0.514=2×0.0287=0.0574.
Since 0.0574>0.05, we do not reject H0.
Using the log-linear binomial distribution, we haven=14, yd=3, and(5.6)ω=1(55)(3)/(25)(8)=1.1,
and the Pvalue is
(5.7)2Pvalue.lb=∑j=03(14j)0.5141.1j(14-j)∑t=014(14t)0.5141.1t(14-t)=2(0.00687)=0.0137,
where 0.0137<0.05, so we reject H0. That is, we would conclude that monkeys prefer stimulation in brain area B to stimulation in area A. Note that the rejection of H0 agrees with Wilcoxon Signed-Ranks test for the same data; see the work of Weaver in [12] and Siegel and Castellan in  [13].Table 1
Number of bar presses in brain stimulation experiment.
Subjectbar 1bar 2DifferenceZi (sign)12040−200(-)21825−70(-)32438−140(-)41427−130(-)5531−260(-)6262151(+)71532−170(-)82938−90(-)91525−100(-)10918−90(-)112532−70(-)12312831(+)13353321(+)141229−170(-)The data are obtained from Weaver [12].Power of the Test
Following the method given by Groebner et al. in [14], we may use the normal approximation to study the power of the sign test at n=14, ω=1.1 and using one-tail test for simplicity as follows. The power of the test is
(5.8)power=1-β,β=P(acceptH0∣H0isfalse).
For one-tailed test H0: τ≤0.5 and H1: τ>0.5 using binomial distribution with n=14, τ=0.5 and σ=14(0.5)(0.5)=1.8708. The critical value with α=0.05 is
(5.9)y0.05,b=14(0.5)+1.645(1.8708)=10.077.
The  power of the test is
(5.10)powerb≈1-P(Z<10.077-14τ11.8708),
for τ1>0.5.
Using log-linear binomial distribution withn=14, ψ=0.5, and ω=1.1, we obtain σ=1.4616, then under H0 and α=0.05, the critical value is(5.11)y0.05,lb=14(0.5)+1.645(1.4616)=9.404.
The power of the test under log-linear binomial distribution is
(5.12)powerlb≈1-P(Z<9.404-14τ11.4616),τ1>0.5.
Power of the sign test is given in Table2. In this case, the log-linear binomial distribution shows improvement in the power of the sign test over the sign test under binomial; for example, when τ1=0.70, the power increases from 0.44 to 0.61 about 1.40 times.Table 2
Power of the sign test under binomial and log-linear binomial distribution for one-tail test withn=14, ω=1.1, and α=0.05 based on normal approximation.
τ10.50.600.700.800.900.95Binomial distributionZ1.640.890.15−0.60−1.35−1.72Power0.050.180.440.730.910.96Log-linear binomial distributionZ1.640.68−0.27−1.23−2.18−2.66Power0.050.250.610.890.980.996


## 5.1.1. Sign Test Under Dependence of the Trials

Suppose the assumption of mutual independence in the data is violated and the trails are dependent; see, for example, the work of Tallis in [10] and Luceño [11]. In this case, we suggest the log-linear binomial distribution as a sampling distribution of sd=∑i=1nZi rather than the binomial distribution. Let τ=P(X>Y)=P(Z=1)=ψ(κn-1(ψ,ω)/κn(ψ,ω)) represent the probability of success. Then the null hypothesis H0: τ=0.5 is equivalent to H0: ψ=0.5. Therefore, under the null hypothesis, the rejection region can be obtained as
(5.4)Pvalue⋅lb=P(rejectH0∣H0istrue,n,yd,ω)=∑j=0yd(nj)0.5nωj(n-j)∑t=0n(nt)0.5nωt(n-t),
where yd=min(#1,#0) and ω=1/CPR. For a two-tailed test,  we reject H0 if 2Pvalue.lb≤α, else do not reject H0 and α is a prespecified value (H0: there is no difference  against  H1: there is difference.)Example 5.1.
A physiologist wants to know if monkeys prefer stimulation of brain area A to stimulation of brain area B. In the experiment, 14 rhesus monkeys from the same family are taught to press two bars. When a light comes on, presses on Bar 1 result in stimulation of area A and presses on Bar 2 result in stimulation of area B. After learning to press the bars, the monkeys are tested for 15 minutes, during which time the frequencies for the two bars are recorded. The data are shown in Table1.
Using the binomial distribution, we haven=14, yd=3, and Pvalue is(5.5)2Pvalue=∑j=03(14j)0.514=2×0.0287=0.0574.
Since 0.0574>0.05, we do not reject H0.
Using the log-linear binomial distribution, we haven=14, yd=3, and(5.6)ω=1(55)(3)/(25)(8)=1.1,
and the Pvalue is
(5.7)2Pvalue.lb=∑j=03(14j)0.5141.1j(14-j)∑t=014(14t)0.5141.1t(14-t)=2(0.00687)=0.0137,
where 0.0137<0.05, so we reject H0. That is, we would conclude that monkeys prefer stimulation in brain area B to stimulation in area A. Note that the rejection of H0 agrees with Wilcoxon Signed-Ranks test for the same data; see the work of Weaver in [12] and Siegel and Castellan in  [13].Table 1
Number of bar presses in brain stimulation experiment.
Subjectbar 1bar 2DifferenceZi (sign)12040−200(-)21825−70(-)32438−140(-)41427−130(-)5531−260(-)6262151(+)71532−170(-)82938−90(-)91525−100(-)10918−90(-)112532−70(-)12312831(+)13353321(+)141229−170(-)The data are obtained from Weaver [12].Power of the Test
Following the method given by Groebner et al. in [14], we may use the normal approximation to study the power of the sign test at n=14, ω=1.1 and using one-tail test for simplicity as follows. The power of the test is
(5.8)power=1-β,β=P(acceptH0∣H0isfalse).
For one-tailed test H0: τ≤0.5 and H1: τ>0.5 using binomial distribution with n=14, τ=0.5 and σ=14(0.5)(0.5)=1.8708. The critical value with α=0.05 is
(5.9)y0.05,b=14(0.5)+1.645(1.8708)=10.077.
The  power of the test is
(5.10)powerb≈1-P(Z<10.077-14τ11.8708),
for τ1>0.5.
Using log-linear binomial distribution withn=14, ψ=0.5, and ω=1.1, we obtain σ=1.4616, then under H0 and α=0.05, the critical value is(5.11)y0.05,lb=14(0.5)+1.645(1.4616)=9.404.
The power of the test under log-linear binomial distribution is
(5.12)powerlb≈1-P(Z<9.404-14τ11.4616),τ1>0.5.
Power of the sign test is given in Table2. In this case, the log-linear binomial distribution shows improvement in the power of the sign test over the sign test under binomial; for example, when τ1=0.70, the power increases from 0.44 to 0.61 about 1.40 times.Table 2
Power of the sign test under binomial and log-linear binomial distribution for one-tail test withn=14, ω=1.1, and α=0.05 based on normal approximation.
τ10.50.600.700.800.900.95Binomial distributionZ1.640.890.15−0.60−1.35−1.72Power0.050.180.440.730.910.96Log-linear binomial distributionZ1.640.68−0.27−1.23−2.18−2.66Power0.050.250.610.890.980.996


## 5.2. Fitting Genetic Data

The data are taken from Salmaniyaa hospital records in Bahrain for a genetic study on the gender ratio. Table3 shows the number of male children in 3475 families with 7 children.Table 3
Numbers of male children in 3475 families of size 7
MaleFamiliesBinomialLog-linear binomial01555.8017.531200314.22203.202778758.24769.21312401016.511233.024897817.65903.935295394.62303.07645105.81432.02}7512.16Total347534753475Chi-square193.011.374Note: frequencies marked with bracket were combined for purpose of calculatingχ2The first two sample moments are(5.13)m1=3.12057,M2=1.21567.
If we use binomial distribution, the estimated value of τ from the sample is
(5.14)τ̂=3.120577=0.4458.
This value of τ̂ was used to obtain the expected frequencies shown in Table 3. The value of χ2=193.01 with 7 degrees of freedom givesp=0<0.05, the simple binomial model has to be rejected. If we use log-linear binomial distribution, and fit the data by maximum likelihood, we find that
(5.15)ψ̂=0.423,ω̂=1.14543.
The estimated variance-covariance matrix is
(5.16)V̂(θ̂)≈[70974.89107162510716.258927.83]-1=[0.000017-.000021-.0000210.000137].
The expected frequencies based on these estimates are shown in Table 3. The value of χ2=1.288 with 6 degrees of freedom givesp=0.97>0.05. Thus, the log-linear binomial distribution provides a good fit to the observed data.


## 6. Conclusion

The parameters of the log-linear binomial distribution were estimated by the moment and maximum likelihood methods. Both methods needed solving nonlinear equations to obtain the estimators of the parameters. We used nonlinear equation solver (nleqslv) package in statistical R-software to find the estimates of the parameters. The variance-covariance matrix for the maximum likelihood estimates was obtained. Moreover, the sampling distribution of the sign test was studied when trials are dependent. A set of genetic data from Salmaniyaa hospital in Bahrain has been fitted using log-linear binomial distribution. The fit is found preferable over fitting the binomial distribution.



---

*Source: 423654-2010-12-26.xml*