Nonlin                  package:gnm                  R Documentation

_S_p_e_c_i_f_y _a _S_p_e_c_i_a_l _N_o_n_l_i_n_e_a_r _T_e_r_m _i_n _a _M_o_d_e_l _F_o_r_m_u_l_a

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

     A symbolic wrapper, for use in the formula argument to 'gnm', to
     indicate a nonlinear term that requires special handling.

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

     Nonlin(functionCall, data = NULL)

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

functionCall: a call to a "plug-in" function that provides the objects
          required to fit the special nonlinear term. 

    data: (optional) a data.frame containing any variables in
          *specified* arguments of 'functionCall'. 

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

     Nonlinear terms that cannot be specified by 'Mult' require special
     handling by 'gnm'.  'Nonlin' provides a way of specifying such
     terms in a 'gnm' formula.  

     To fit the special terms, 'gnm' requires certain objects and
     functions, which must be produced by a plug-in function.  The
     'functionCall' argument of 'Nonlin' specifies the call to this
     function that is necessary to fit the desired term.  

     The 'gnm' package includes plug-in functions for multiplicative
     interactions with homogeneous effects ('MultHomog') and diagonal
     reference terms ('Dref').  Users may also define their own plug-in
     functions which should return a list with at least the following
     three components:

     _l_a_b_e_l_s a character vector of labels for the parameters (to which
          'gnm' will prefix the call to the plug-in function).

     _p_r_e_d_i_c_t_o_r a function which takes a vector of parameter estimates
          and returns either a vector of fitted values or a matrix
          whose columns are additive components of the fitted values.

     _l_o_c_a_l_D_e_s_i_g_n_F_u_n_c_t_i_o_n a function which takes the arguments 'coef' (a
          vector of parameter estimates) and  'predictor' (the result
          of the predictor function), and returns the local design
          matrix.

     and optionally one further component

     _s_t_a_r_t either a vector of default starting values for the
          parameters or a function which takes the number of parameters
          and returns a vector of default starting values.

     Any variables passed to unspecified arguments of the plug-in
     function will be automatically added to the model frame used in
     'gnm'. This model frame can be accessed within a plug-in function
     using 'getModelFrame'.  

     The 'data' argument of 'Nonlin' can be used to provide any
     variables required by specified arguments of the plug-in function.
     ALL the variables given in 'data' will be added to the model
     frame.

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

     An object of class '"Nonlin"' which is a list of deparsed
     expressions representing the variables passed to unspecified
     arguments of the plug-in function, with the attributes 

    call: the call to make to the plug-in function. 

extraData: if supplied, the data frame passed to the 'data' argument of
          'Nonlin'. 

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

     Heather Turner

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

     Goodman, L. A. (1979) Simple Models for the Analysis of
     Association in Cross-Classifications having Ordered Categories.
     _J. Am. Stat. Assoc._, *74(367)*, 537-552.

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

     'gnm', 'getModelFrame', 'MultHomog', 'Dref', 'Mult'

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

     set.seed(1)
     data(occupationalStatus)

     ##  Fit an association model with homogeneous row-column effects
     RChomog <- gnm(Freq ~ origin + destination + Diag(origin, destination) +
                    Nonlin(MultHomog(origin, destination)), family = poisson,
                    data = occupationalStatus)

