Usage NotesΒΆ

Function contingencyTable computes many statistics of interest in a two-way table. Statistics computed by this function includes the usual chi-squared statistics, measures of association, Kappa, and many others. Exact probabilities for two-way tables can be computed by exactEnumeration, but this function uses the total enumeration algorithm and, thus, often uses orders of magnitude more computer time than exactNetwork, which computes the same probabilities by use of the network algorithm (but can still be quite expensive).

The function categoricalGlm in the second section is concerned with generalized linear models (see McCullagh and Nelder 1983) in discrete data. This function can be used to compute estimates and associated statistics in probit, logistic, minimum extreme value, Poisson, negative binomial (with known number of successes), and logarithmic models. Classification variables as well as weights, frequencies and additive constants may be used so that general linear models can be fit. Residuals, a measure of influence, the coefficient estimates, and other statistics are returned for each model fit. When infinite parameter estimates are required, extended maximum likelihood estimation may be used. Log-linear models can be fit in categoricalGlm through the use of Poisson regression models. Results from Poisson regression models involving structural and sampling zeros will be identical to the results obtained from the log-linear model functions but will be fit by a quasi-Newton algorithm rather than through iterative proportional fitting.

Two additional functions, logisticRegression and logisticRegPredict, are designed specifically for logistic regression. logisticRegression estimates a logistic regression model for binomial and multinomial response variables and one or more independent variables. Given an estimated model, logisticRegPredict calculates predicted responses at new values of the regression variables.