Fits generalized linear models with multinomial distribution (R.W. Payne).
|What to print (
||Factor representing the response categories of the multinomial distribution|
||Factors classifying the subjects; default uses the factors in
||Limit for expansion of model terms from
||Whether to pool ss in accumulated summary between all terms fitted in a linear model (
||Whether to base ratios in accumulated summary on rms from model with smallest residual ss or smallest residual ms (
||Which warning messages to suppress (
||Printing of probabilities for variance and deviance ratios (
||Printing of probabilities for t-statistics (
||Statistics to be displayed in the summary of analysis produced by
||Probability level for confidence intervals for parameter estimates; default 0.95|
||Whether to assign all possible parameters to factors and interactions (
||Terms to be fitted|
FITMULTINOMIAL provides an automatic way of fitting generalized linear models with the multinomial distribution. These models can be fitted with the ordinary generalized linear models commands, by using the fact that a multinomial distribution can be generated by taking the sum of several Poisson variables (one for each outcome of the multinomial), and then constraining their sum to be equal to the multinomial total (see McCullagh & Nelder 1989, or any book on probability distributions).
The data for the model are counts of numbers of subjects observed in the various categories of the multinomial distribution. The counts may also be classified by various treatment factors, and the interest is in seeing how distribution of the subjects varies according to the treatments or any variates that differ over the levels of the treatments. These observations must be put into a single variate, and specified beforehand using
Y parameter of the
MODEL directive. The
DISTRIBUTION option of
MODEL should be set to
Poisson, and the
LINK option to
logarithm (or left as the default
canonical for the canonical link, which is
logarithm for the Poisson); this gives a logit link in the multinomial.
You also need to form a factor to identify the response category of the multinomial recorded in each unit of the
Y variate. This is then input to
FITMULTINOMIAL using the
FITMULTINOMIAL also has a
CLASSIFICATION option that can be used to specify the factors that classify the subjects. The other options have the same purpose as those in the
FIT directive. The model to be fitted is specified by the
TERMS parameter (like the first parameter of
CLASSIFICATION is unset,
FITMULTINOMIAL will use the set of factors that occur in
TERMS. Usually these will contain all the factors that classify the subjects. However, if you have a classification factor with numerical levels, you might for example want to fit a variate calculated as some function of the levels rather that a effect for every level of the factor. You could then specify the factors in the list for the
CLASSIFICATION option, and use the variate in
FITMULTINOMIAL first fits a model defined as all factorial combinations of the
CLASSIFICATION factors. This imposes the constraint that the Poisson variables sum to the totals of the multinomial distribution. The effects of these terms assess how the design has been set up – i.e. how the subjects have been allocated to the treatments – but they have no information on the effects of the treatments on the response.
It then fits
RESPONSEFACTOR. This represents the overall distribution of the response categories across the subjects, and is analogous to the grand mean in an ordinary analysis. (This must be fitted, and so
FITMULTINOMIAL has no
Finally it fits the interactions of the terms in
RESPONSEFACTOR. These show how the distribution of subjects to response categories is affected by the treatment terms – which is the main interest of the analysis. The
FACTORIAL option sets a limit on the number of factors and/or variates in the model terms that are generated from the
TERMS formula. (Note, though, that the
RESPONSEFACTOR is ignored in interpreting this limit). By default these terms are fitted individually, so they will each have their own line in an accumulated analysis of deviance (option
PRINT=accumulated). However, you can set option
POOL=yes to fit them all at once.
If you have a large model, you can set the GROUPS option in the earlier
MODEL statement to the response factor to save space. Note, though, that if you want to use the
PREDICT directive after
FITMULTINOMIAL, you will then only be able to predict values within one response category at a time.
FITMULTINOMIAL uses the standard generalized linear models commands, as explained in the Description.
McCullagh, P. & Nelder, J.A. (1989). Generalized Linear Models (second edition). Chapman & Hall, London.
Commands for: Regression analysis.
CAPTION 'FITMULTINOMIAL example',\ !t('Frequencies of central nervous system malformations',\ 'in live births in 8 South Wales communities',\ '(McCullagh & Nelder 1989, Table 5.3).'); STYLE=meta,plain FACTOR [NVALUES=64; LABELS=!t(Cardiff,Newport,Swansea,'Glamorgan E.',\ 'Glamorgan W.','Glamorgan C.','Monmouth V.','Monmouth other')]\ community & [LABELS=!t('Non-manual',Manual)] worker & [LABELS=!t(None,'An.','Sp.',Other)] CNS GENERATE community,worker,CNS VARIATE births; VALUES=!(\ 4091, 5, 9,5, 9424,31,33,14,\ 1515, 1, 7,0, 4610, 3,15, 6,\ 2394, 9, 5,0, 5526,19,30, 4,\ 3163, 9,14,3, 13217,55,71,19,\ 1979, 5,10,1, 8195,30,44,10,\ 4838,11,12,2, 7803,25,28,12,\ 2362, 6, 8,4, 9962,36,37,13,\ 1604, 3, 6,0, 3172, 8,13, 3)\ TABLE [CLASS=community; VALUES=110,100,95,42,39,161,83,122] hardtable CALCULATE waterhardness = TPROJECT(hardtable) MODEL [DISTRIBUTION=poisson; LINK=log] births CAPTION !t('Notice the aliasing between terms involving waterhardness',\ 'and those involving community. This is because waterhardness',\ 'is defined by the location of the communities, and thus is a',\ 'contrast between community effects.') FITMULTINOMIAL [PRINT=#,accumulated; RESPONSEFACTOR=CNS; FPROBABILITY=yes]\ waterhardness + community + worker