Lindsey {MM} | R Documentation |
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 class 'Lindsey_output'
print(x, ...)
Arguments
obs |
In |
n |
Vector with elements corresponding to the rows of |
a |
In |
give_fit |
Boolean, with default |
x |
In the print method, object of class |
... |
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
.
Author(s)
P. M. E. Altham and Robin K. S. Hankin
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
Examples
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)
## End(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))