MM (version 1.6-5)

Lindsey: The Poisson device of Lindsey and Mersch (1992).

Description

Function Lindsey() returns a maximum likelihood fit of the multiplicative multinomial using the Poisson device of Lindsey and Mersch (1992), and in the context of the multiplicative multinomial by Altham and Lindsey (1998).

Function Lindsey_MB() returns a maximum likelihood fit for the multivariate multiplicative binomial, for the special case of a bivariate distribution. An example of coercing a table to the correct form for use with Lindsey_MB() is given in the examples section below. Also, see danaher for another example.

Usage

Lindsey(obs, n = NULL, give_fit = FALSE)
Lindsey_MB(a)
# S3 method for Lindsey_output
print(x, ...)

Arguments

obs

In Lindsey(), an integer matrix with each row corresponding to an observation. All row sums must match

n

Vector with elements corresponding to the rows of obs; default of NULL corresponds to observing each row of obs once

a

In Lindsey_MB(), an object that is coerced to one of class gunter_MB. Typically, the user supplies an Oarray object or an MB object

give_fit

Boolean, with default FALSE meaning to return just the fit, coerced to an object of class paras and TRUE meaning to return a list with two elements, the first being a paras object and the second being the fit returned by glm()

x

In the print method, object of class Lindsey_output

...

In the print method, further arguments, currently ignored

Details

Uses the device first described by Lindsey in 1992; the ‘meat’ of which has R idiom

Off <- -rowSums(lfactorial(jj$tbl))

glm(jj$d ~ -1 + offset(Off) + (.)^2, data=data, family=poisson)

Function Lindsey(..., give_fit=TRUE) returns an object of class Lindsey_output, which has its own print method (which prints the summary of the fit rather than use the default method).

Function Lindsey(..., give_fit=FALSE) returns an object of class paras, which can then be passed on to functions such as rMM(), which take a paras object.

Function Lindsey_MB() returns an object of class glm.

References

  • J. K. Lindsey and G. Mersch 1992. “Fitting and comparing probability distributions with log linear models”, Computational Statistics and Data Analysis, 13(4):373--384

  • P. M. E. Altham and J. K. Lindsey, 1998. “Analysis of the human sex ratio using overdispersion models”, Applied Statistics, 47:149--157

See Also

gunter, danaher

Examples

Run this code
# NOT RUN {
data(voting)
(o <- Lindsey(voting, voting_tally))
rMM(10,5,o)

data(danaher)
Lindsey_MB(danaher)

# }
# NOT RUN {
  #(takes a long time)
data(pollen)
Lindsey(pollen)
# }
# NOT RUN {
# Example of Lindsey_MB() in use follows.
 
a <- matrix(c(63,40,26,7,69,42,19,5,48,21,16,2,33,11,9,1,21,8,9,0,
    7,8,1,0,5,3,1,0,9,2,0,0),byrow=TRUE,ncol=4)

# Alternatively, you can get this from the pscl package as follows:
# library(pscl); data(bioChemists)
# a <- table(subset(bioChemists, fem == 'Men' & art < 8))

dimnames(a) <- list(papers=0:7,children=0:3)
require(Oarray)
a <- as.Oarray(a,offset=0)
# thus a[3,1]==11 means that 11 subjects had 3 papers and 1 child

summary(Lindsey_MB(a))
# }

Run the code above in your browser using DataLab