Because of the special nature of the binomial distribution, an small illustrative example will given. A binomial response variable consists of two columns: the first for the counts, and the second for the sample sizes. Alternatively, the counts can be given as the response data with the sample sizes as prior weights. When the data to be analysed is in the form of probabilities, only one column is needed.
The data comes from Bliss [2] (cited in Dobson [3]) and is shown in Table 5.5. The data involves counting the number of beetles killed after five hours of exposure to various concentration of gaseous carbon disulphide (CS2). The analysis concerns estimating the proportion ri/ni of beetles killed by the gas.
Dose Number of Beetles Number of Beetles (log10 CS_2 mg l^-1) (ni) Killed (ri) 1.6907 59 6 1.7242 60 13 1.7552 62 18 1.7842 56 28 1.8113 63 52 1.8369 59 53 1.8610 62 60 1.8839 60 60 Beetles Mortality Data
The variables in MATLAB were named Dose, Number and Killed for the obvious variables. Dobson analyses the data using a logit link function. The data is entered into glmlab as shown in Figure 5.5. Note the entry for the response variable, which is entered as two columns. After choosing the binomial distribution and the logit link function from the menus, the results are given below:
=== INFO :-| ========================================================
Response Variable: [Killed,Number]
Covariates: Dose
- fitting a constant term/intercept
------------------------------------------------------------
Estimate S.E. Variable
------------------------------------------------------------
-60.717455 5.180701 Constant
34.270326 2.912134 Dose
------------------------------------------------------------
Scaled deviance: 11.232231 Link: LOGIT
Residual df: 6 Distribution: BINOML
Scale parameter (dispersion parameter): 1.000000
Output variables: BETA SERRORS FITS RESIDS COVB COVD
DEVLIST LINPRED XMATRIX XVARNAMES
The results agree with those given in Dobson. An alternative method is to fit the model using the probabilities ri/ni as the response (that is, one column of probabilities), and use ni as the prior weights. The parameter estimates are identical. The residual plotted against the fitted values shows a possible curvature. However, using the complementary log-log link function improves the fit greatly. Use this link and see the improvement yourself.
![]()
Variables Entered for the Beetle Mortality Example