ipf([Model] [, print:F or silent:T, incr:T, pvals:T, maxiter:m,\ epsilon:eps]), vec a REAL vector, m an integer > 0, eps REAL > 0 |

ipf(Model) uses iterative proportional fitting to compute a Poisson regression (log linear) fit of the model specified in the CHARACTER variable Model. The default output is the deviance from the full model. See topic 'models' for information on specifying Model. ipf(Model,inc:T) fits the same model except a sequential analysis of deviance is computed. The sequential analysis of deviance has a line for each term in the model giving the term name, degrees of freedom, and the change of deviance obtained by including the term in the given order. Because each of the submodels must be fit iteratively, with a complicated models or a large data set ipf(Model,inc:T) can take many times longer to execute than ipf(Model). ipf(Model [,...], pvals:T) prints chi-squared P values with each deviance. If option 'pvals' has value True, P values will be printed unless pvals:F is an argument. ipf([,keywords]) or ipf(,inc [,keywords]) fits the last model used by any of the GLM commands such as regress() or poisson(). See topic 'glm'. If there are any non-factors in the model ipf() defaults to poisson(). ipf() also defaults to poisson(), if it does not identify the model as balanced. The only forms of balance it recognizes are complete balance (equal number of cases in every cell) and balanced main effect models (no interactions and all two-way marginals have equal cell sizes, for example a Latin square design) ipf() sets the side effect variables RESIDUALS, WTDRESIDUALS, SS, DF, HII, DEPVNAME, TERMNAMES, and STRMODEL. See topic 'glm'. All except HII should be the same as computed by poisson(Model,inc) used. Since HII cannot be computed easily, it is set to a constant vector with values m/n where m = (Model degrees of freedom) and n is the number of values in the dependent variable vector. Thus sum(HII) = m as it should. Without keyword phrase 'inc:T' (see below), TERMNAMES has value vector("","", ...,"Overall model","ERROR1"), DF has value vector(0,0, ..., ModelDF,ErrorDF) and SS has value vector(0,0,...,ModelDeviance, ErrorDeviance). ipf(Model,maxiter:m,epsilon:eps), where m is a positive integer and eps is positive, is the same as ipf(Model) except up to m iterations may take place (the default is 25) and eps is the convergence criterion (default 1e-6). You need not specify either or both. ipf(Model [,...], print:F) is the same as ipf(Model [,...]) except that most printing is suppressed and the only result is to set the side effect variables. ipf(Model [,...], silent:T) does computations, creating side effect variables, but prints nothing except actual error messages. Keyword phrase 'coefs:F' cannot be used with ipf(). Coefficients may be retrieved by coefs(); standard errors are not available. You must use poisson() if you require standard errors.

Gary Oehlert 2003-01-15