Skip to main content
Statistics LibreTexts

18.6: End-of-Chapter Materials

  • Page ID
    57807
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    R Functions

    In this chapter, we were introduced to several R functions that will be useful in the future. These are listed here.

    Packages

    • KnoxStats
      This package still contains some helpful functions. Here, we used it for the set.base and the accuracy functions.
    • MASS
      This package is also a "book package," a package created for a specific book. Here, that book is Modern Applied Statistics with S, by Venables and Ripley.
    • nnet
      This package contains many functions dealing with neural networks. For this chapter, we use it to fit multinomial models.

    Statistics

    • multinom()
      This modeling function allows you to fit nominal dependent variables. Its structure is standard in that its main argument is the formula. In order to use the multinom function, you must load the nnet package.
    • polr()
      This modeling function allows you to fit ordinal dependent variables when there is an underlying linear function that drives the process. In order to use the polr function, you must load the MASS package.
    • predict(model, newdata)
      As with almost all statistical packages, R has a predict function. It takes two parameters, the model, and a dataframe of the independent values from which you want to predict. If you omit newdata, then it will predict based on the independent variables of the data itself, which can be used to calculate residuals. The dataframe must list all independent variables with their associate new values. You can specify multiple new values for a single independent variable.
    • set.base()
      This allows one to change the base category from which all other levels are estimated. It is a member of the KnoxStats package.
    • accuracy()
      This calculates the basic accuracy of a confusion matrix. To be meaningful, this assumes the data are representative of the population.

    Exercises

    This section offers suggestions on things you can practice from this chapter.

    1. In Section 18.1: Nominal Dependent Variables, we fit a multinomial model to the gssocc data. The base used was "Blue Collar." Refit the model using "Craft" as the base category.
    2. Determine the AIC of the null model in Section 18.1: Nominal Dependent Variables.
    3. As mentioned in Section 18.2: Ordinal Dependent Variables, calculate the relative accuracy of the model of the example.
    4. As mentioned in Section 18.2: Ordinal Dependent Variables, add a quadratic education term to the model in the example to see if both the highly educated and the lesser educated both support the president.

    Applied Readings

    • Paul D. Allison and Nicholas A. Christakis (1994). "Logit Models for Sets of Ranked Items." Sociological Methodology. 24: 199–228.
    • John Fox and Robert Andersen (2006). "Effect Displays for Multinomial and Proportional-Odds Logit Models." Sociological Methodology. 36: 225–55.
    • Daniel Carson Johnson (1997). "Formal Education vs. Religious Belief: Soliciting New Evidence with Multinomial Logit Modeling." Journal for the Scientific Study of Religion. 36(2): 231–46.
    • Mark R. Killingsworth and Cordelia W. Reimers (1983). "Race, Ranking, Promotions, and Pay at a Federal Facility: A Logit Analysis." Industrial and Labor Relations Review. 37(1): 92–107.
    • Alan B. Lowther and John R. Skalski (1998). "A Multinomial Likelihood Model for Estimating Survival Probabilities and Overwintering for Fall Chinook Salmon Using Release: Recapture Methods." Journal of Agricultural, Biological, and Environmental Statistics. 3(2): 223–36.
    • Christopher Winship and Robert D. Mare (1984). "Regression Models with Ordinal Variables." American Sociological Review. 49(4): 512–25.
    • Judith E. Zeh, Daijin Ko, Bruce D. Krogman and Ronald Sonntag (1986). "A Multinomial Model for Estimating the Size of a Whale Population from Incomplete Census Data." Biometrics. 42(1): 1–14.

    Theory Readings

    • B. R. Bhat and N. V. Kulkarni (1966). "On Efficient Multinomial Estimation." Journal of the Royal Statistical Society. Series B (Methodological). 28(1): 45–52.
    • Zhen Chen and Lynn Kuo (2001). "A Note on the Estimation of the Multinomial Logit Model with Random Effects." The American Statistician. 55(2): 89–95.
    • Jean-Yves Dauxois and Syed N. U. A. Kirmani (2003). "Testing the Proportional Odds Model under Random Censoring." Biometrika. 90(4): 913–22.
    • Byung Soo Kim and Barry H. Margolin (1992). "Testing Goodness of Fit of a Multinomial Model Against Overdispersed Alternatives." Biometrics. 48(3): 711–19.
    • Bercedis Peterson and Frank E. Harrell, Jr. (1990). "Partial Proportional Odds Models for Ordinal Response Variables." Journal of the Royal Statistical Society. Series C (Applied Statistics). 39(2): 205–17.
    • G. A. F. Seber and S. O. Nyangoma (1974). "Residuals for Multinomial Models." Biometrika. 87(1): 183–91.
    • M. Stone (1974). "Cross-Validation and Multinomial Prediction." Biometrika. 61(3): 509–15.
    • Y. K. Tse (1987). "A Diagnostic Test for the Multinomial Logit Model." Journal of Business & Economic Statistics. 5(2): 283–86.

    This page titled 18.6: End-of-Chapter Materials is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Ole Forsberg.

    • Was this article helpful?