multinom                package:nnet                R Documentation

_F_i_t _M_u_l_t_i_n_o_m_i_a_l _L_o_g-_l_i_n_e_a_r _M_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     Fits multinomial log-linear models via neural networks.

_U_s_a_g_e:

     multinom(formula, data, weights, subset, na.action,
              contrasts = NULL, Hess = FALSE, summ = 0, censored = FALSE,
              model = FALSE, ...)

_A_r_g_u_m_e_n_t_s:

 formula: a formula expression as for regression models, of the form
          'response ~ predictors'. The response should be a factor or a
          matrix with K columns, which will be interpreted as counts
          for each of K classes. A log-linear model is fitted, with
          coefficients zero for the first class. An offset can be
          included: it should be a numeric matrix with K columns if the
          response is either a matrix with K columns or a factor with K
          > 2 classes, or a numeric vector for a response factor with 2
          levels. See the documentation of 'formula()' for other
          details. 

    data: an optional data frame in which to interpret the variables
          occurring in 'formula'. 

 weights: optional case weights in fitting. 

  subset: expression saying which subset of the rows of the data should
           be used in the fit. All observations are included by
          default. 

na.action: a function to filter missing data. 

contrasts: a list of contrasts to be used for some or all of the
          factors appearing as variables in the model formula. 

    Hess: logical for whether the Hessian (the observed/expected
          information matrix) should be returned. 

    summ: integer; if non-zero summarize by deleting duplicate rows and
          adjust weights. Methods 1 and 2 differ in speed (2 uses 'C');
          method 3 also combines rows with the same X and different Y,
          which changes the baseline for the deviance. 

censored: If Y is a matrix with 'K > 2' columns, interpret the entries
          as one for possible classes, zero for impossible classes,
          rather than as counts. 

   model: logical. If true, the model frame is saved as component
          'model' of the returned object. 

     ...: additional arguments for 'nnet' 

_D_e_t_a_i_l_s:

     'multinom' calls 'nnet'.  The variables on the rhs of the formula
     should be roughly scaled to [0,1] or the fit will be slow or may
     not converge at all.

_V_a_l_u_e:

     A 'nnet' object with additional components:

deviance: the residual deviance, compared to the full saturated model
          (that explains individual observations exactly).  Also, minus
          twice log-likelihood. 

     edf: the (effective) number of degrees of freedom used by the
          model 

     AIC: the AIC for this fit. 

 Hessian: (if 'Hess' is true). 

   model: (if 'model' is true). 

_R_e_f_e_r_e_n_c_e_s:

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth edition.  Springer.

_S_e_e _A_l_s_o:

     'nnet'

_E_x_a_m_p_l_e_s:

     options(contrasts = c("contr.treatment", "contr.poly"))
     library(MASS)
     example(birthwt)
     (bwt.mu <- multinom(low ~ ., bwt))
     ## Not run: Call:
     multinom(formula = low ~ ., data = bwt)

     Coefficients:
      (Intercept)         age         lwt raceblack raceother
         0.823477 -0.03724311 -0.01565475  1.192371 0.7406606
          smoke      ptd        ht        ui       ftv1     ftv2+
       0.7555234 1.343648 1.913213 0.6802007 -0.4363238 0.1789888

     Residual Deviance: 195.4755
     AIC: 217.4755
     ## End(Not run)

