hitmiss                 package:pscl                 R Documentation

_T_a_b_l_e _o_f _A_c_t_u_a_l _O_u_t_c_o_m_e_s _a_g_a_i_n_s_t _P_r_e_d_i_c_t_e_d _O_u_t_c_o_m_e_s _f_o_r _d_i_s_c_r_e_t_e
_d_a_t_a _m_o_d_e_l_s

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

     Cross-tabulations of actual outcomes against predicted outcomes
     for discrete data models, with summary statistics such as percent
     correctly predicted (PCP) under fitted and null models.  For
     models with binary responses (generalized linear models with
     'family=binomial'), the user can specific a classification
     threshold for the predicted probabilities.

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

     hitmiss(obj, digits = max(3, getOption("digits") - 3), ...)

     ## S3 method for class 'glm':
     hitmiss(obj,digits=max(3,getOption("digits")-3),
                 ...,
                 k=.5)

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

     obj: a fitted model object, such as a 'glm' with
          'family=binomial', a 'polr' model for ordinal responses, or a
          'multinom' model for unordered/multinomial outcomes

  digits: number of digits to display in on-screen output

     ...: additional arguments passed to or from other functions

       k: classification threshold for binary models

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

     For models with binary responses, the user can specify a parameter
     0 < 'k' < 1; if the predicted probabilities exceed this threshold
     then the model is deemed to have predicted y=1, and otherwise to
     have predicted y=0.  Measures like percent correctly predicted are
     crude summaries of model fit; the cross-tabulation of actual
     against predicted is somewhat more informative, providing a little
     more insight as to where the model fits less well.

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

     For 'hitmiss.glm', a vector of length 3: 

     pcp: Percent Correctly Predicted

    pcp0: Percent Correctly Predicted among y=0

    pcp1: Percent Correctly Predicted among y=1

_N_o_t_e:

     ToDo: The 'glm' method should also handle binomial data presented
     as two-vector success/failures counts; and count data with
     'family=poisson', the 'glm.nb' models and 'zeroinfl' and 'hurdle'
     etc.   We should also make the output a class with prettier print
     methods, i.e., save the cross-tabulation in the returned object
     etc.

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

     Simon Jackman jackman@stanford.edu

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

     'pR2' for pseudo r-squared;  'predict'; 'extractAIC'.  See also
     the 'lroc' function in the 'epicalc' package for ROC computations.

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

     data(admit)
     require(MASS)
     ## ordered probit model
     op1 <- polr(score ~ gre.quant + gre.verbal + ap + pt + female,
                 Hess=TRUE,
                 data=admit,
                 method="probit")
     hitmiss(op1)

