

   FFuunnccttiioonn ttoo ssoollvvee aa GGeenneerraalliizzeedd EEssttiimmaattiioonn EEqquuaattiioonn MMooddeell
   ((vveerrssiioonn 44..33))

        gee(formula, id,
            data, subset, na.action,
            offset=NA, R=NA, b=NA,
            tol=0.001, maxiter=as.integer(25),
            family = gaussian, corstr="independence",
            Mv=1, silent=T, contrasts=NULL,
            scale.fix = F, scale.value = 1)

   AArrgguummeennttss::

    formula: a formula expression as for other regression mod-
             els, of the form response ~ predictors. See the
             documentation of lm and formula for details.

         id: a vector which identifies the clusters.  The
             length of id should be the same as the number of
             observations.  Data are assumed to be sorted so
             that observations on a cluster are contiguous rows
             for all entities in the formula.

       data: an optional data frame in which to interpret the
             variables occurring in the formula, along with the
             id, offset and n variables.

     subset: expression saying which subset of the rows of the
             data should  be  used in the fit.  This can be a
             logical vector (which is replicated to have length
             equal to the number of observations), or a numeric
             vector indicating which observation numbers are to
             be included, or a  character  vector of the row
             names to be included.  All observations are
             included by default.

   na.action: a function to filter missing data.  For gee only
             na.omit should be used here.

     offset: a vector giving the offset.  If the length of off-
             set is less than the length of the response, then
             offset is replicated to the appropriate length.

          R: a square matrix of dimension maximum cluster size
             containing the user specified correlation.  This
             is only appropriate if corstr="fixed".

          b: an initial estimate for the parameters.

        tol: the tolerance used in the fitting algorithm.

    maxiter: the maximum number of iterations.

     family: a family object: a list of functions and expres-
             sions for defining link and variance functions.
             Families supported in gee are gaussian, binomial,
             poisson, Gamma, and quasi; see the glm and family
             documentation.  Some links are not currently
             available: 1/mu^2 and sqrt have not been hard-
             coded in the cgee engine at present.  The inverse
             gaussian variance function is not available.  All
             combinations of remaining functions can be
             obtained either by family selection or by the use
             of quasi.  Future releases will allow S-coded
             functions for link, variance and correlation func-
             tion specification.

     corstr: a character specifying the Correlation structure.
             The following are permitted:

             "independence" "fixed" "stat_M_dep"
             "non_stat_M_dep" "exchangeable" "AR-M" "unstruc-
             tured"

         Mv: When the corstr is "stat_M_dep", "non_stat_M_dep",
             or "AR-M" then Mv must be specified.

     silent: a logical variable controlling whether parameter
             estimates at each iteration are printed.

   contrasts: a list giving contrasts for some or all of the
             factors appearing in the model formula.  The ele-
             ments of the list should have the same name as the
             variable and should be either a contrast matrix
             (specifically, any full-rank matrix with as many
             rows as there are levels in the factor), or else a
             function to compute such a matrix given the number
             of levels.

   scale.fix: a logical variable; if true, the scale parameter
             is fixed at the value of scale.value

   scale.value: numeric variable giving the value to which the
             scale parameter should be fixed; used only if
             scale.fix == T.

   VVaalluuee::

        An object of class "gee" representing the fit.

   RReeffeerreenncceess::

        Liang, K.Y. and Zeger, S.L. (1986).  Longitudinal data
        analysis using generalized linear models.  Biometrika
        73: 13-22.

        Zeger, S.L. and Liang, K.Y. (1986).  Longitudinal data
        analysis for discrete and continuous outcomes.  Biomet-
        rics 42: 121-130.

   SSeeee AAllssoo::

        `glm', `lm', `formula'.

   EExxaammpplleess::

        gee(y~x,id)   # Gaussian model with independent correlation structure

        gee(d ~ x1+x2,id,link="logit",family=binomial,corstr="exchangeable")

        gee(d~x1+x2,id=id,family=binomial(link=(probit)),corstr="stat_M_dep",M=1)

