| suffstats {MM} | R Documentation |
Sufficient statistics for the multiplicative multinomial
Description
Calculate, manipulate, and display sufficient statistics of the multiplicative multinomial. Functionality for analysing datasets, and distributions specified by their parameters is given; summary and print methods are also documented here.
Usage
suffstats(y, n = NULL)
expected_suffstats(L,Y)
## S3 method for class 'suffstats'
print(x, ...)
## S3 method for class 'suffstats'
summary(object, ...)
## S3 method for class 'summary.suffstats'
print(x, ...)
Arguments
y, n |
In function |
L, Y |
In function |
x, object |
An object of class |
... |
Further arguments to the print or summary methods. Currently ignored |
Details
Function suffstats() returns a list comprising a set of
sufficient statistics for the observations y,[n].
This function requires that the rowsums of y are all
identical.
Value
Function suffstats() returns a list of four components:
- Y
Rowsums of
y- nobs
Number of observations
- row_sums
Column sums of
y, counted with multiplicity- cross_prods
Matrix of summed squares
Function summary.suffstats() provides a summary of a
suffstats object that is a list with two elements:
row_sums and cross_prods, normalized with nobs and
Y so that the values are comparable with that returned by
expected_suffstats(). In particular, the sum of row_sums
is the known sum \(y\).
Author(s)
Robin Hankin and P. M. E. Altham
Examples
data(voting)
suffstats(voting, voting_tally)
data(wilson)
wilson <- gunter(non_met)
suffstats(wilson)
L <- Lindsey(wilson)
expected_suffstats(L,5)
summary(suffstats(wilson)) ## matches.
summary(suffstats(rMM(10,5,L))) # should be close.