grc                   package:VGAM                   R Documentation

_F_i_t_t_i_n_g _G_o_o_d_m_a_n'_s _R_C _A_s_s_o_c_i_a_t_i_o_n _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     Fits a Goodman's RC Association Model to a matrix of counts

_U_s_a_g_e:

     grc(y, Rank = 1, Index.corner = 2:(1 + Rank),
         Structural.zero = 1, summary.arg = FALSE, h.step = 1e-04, ...)

_A_r_g_u_m_e_n_t_s:

       y: A matrix of counts. Output from 'table()' is acceptable; it
          is converted into a matrix. Note that 'y' must be at least 3
          by 3.  

    Rank: An integer in the range  {1,...,'min(nrow(y), ncol(y))'}. 
          This is the dimension of the fit.

Index.corner: A vector of 'Rank' integers. These are used to store the
          'Rank' by 'Rank' identity matrix in the 'A' matrix; corner
          constraints are used.

Structural.zero: An integer in the range {1,...,'min(nrow(y),
          ncol(y))'}, specifying the row that is used as the structural
          zero. 

summary.arg: Logical. If 'TRUE', a summary is returned. If 'TRUE', 'y'
          may be the output (fitted object) of 'grc()'.

  h.step: A small positive value that is passed into
          'summary.rrvglm()'. Only used when 'summary.arg=TRUE'. 

     ...: Arguments that are passed into 'rrvglm.control()'.

_D_e_t_a_i_l_s:

     Goodman's RC association model can fit a reduced-rank
     approximation to a table of counts.  The log of each cell mean is
     decomposed as an intercept plus a row effect plus a column effect
     plus a reduced-rank part. The latter can be collectively written
     'A %*% t(C)', the product of two `thin' matrices. Indeed, 'A' and
     'C' have 'Rank' columns. By default, the first column and row of
     the interaction matrix 'A %*% t(C)' is chosen  to be structural
     zeros, because 'Structural.zero=1'. This means the first row of
     'A' are all zeros.   

     This function uses 'options()$contrasts' to set up the row and 
     column indicator variables.

_V_a_l_u_e:

     An object of class '"grc"', which currently is the same as an
     '"rrvglm"' object.

_W_a_r_n_i_n_g:

     This function temporarily creates a permanent data frame called
     '.grc.df', which used to be needed by 'summary.rrvglm()'. Then
     '.grc.df' is deleted before exiting the function.  If an error
     occurs, then '.grc.df' may be present in the workspace.

_N_o_t_e:

     This function sets up variables etc. before calling 'rrvglm()'.
     The '...' is passed into 'rrvglm.control()', meaning, e.g.,
     'Rank=1' is default. Seting 'trace=TRUE' may be useful for
     monitoring convergence.

     Using 'criterion="coefficients"' can result in slow convergence.

     If 'summary=TRUE', then 'y' can be a '"grc"' object, in which case
     a summary can be returned. That is, 'grc(y, summary=TRUE)' is
     equivalent to 'summary(grc(y))'.

_A_u_t_h_o_r(_s):

     Thomas W. Yee

_R_e_f_e_r_e_n_c_e_s:

     Goodman, L. A. (1981) Association models and canonical correlation
     in the analysis of cross-classifications having ordered
     categories. _Journal of the American Statistical Association_,
     *76*, 320-334.

     Yee, T. W. and Hastie, T. J. (2003) Reduced-rank vector
     generalized linear models. _Statistical Modelling_, *3*, 15-41.

     Documentation accompanying the 'VGAM' package at  <URL:
     http://www.stat.auckland.ac.nz/~yee> contains further information
     about the setting up of the indicator variables.

_S_e_e _A_l_s_o:

     'rrvglm', 'rrvglm.control', 'rrvglm-class', 'summary.grc', 'auuc'.

_E_x_a_m_p_l_e_s:

     # Some undergraduate student enrolments at the University of Auckland in 1990
     data(auuc) 
     g1 = grc(auuc, Rank=1)
     fitted(g1)
     summary(g1)

     g2 = grc(auuc, Rank=2, Index.corner=c(2,5))
     fitted(g2)
     summary(g2)

