Skip to main content
Statistics LibreTexts

2.2.1: Exercises (Considering Categorical Data)

  • Page ID
    59304
  • \( \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}\)
    \exercisesheader{} % 21 \eoce{\qt{Antibiotic use in children\label{antibiotic_use_children}} The bar plot and the pie chart below show the distribution of pre-existing medical conditions of children involved in a study on the optimal duration of antibiotic use in treatment of tracheitis, which is an upper respiratory infection. \begin{center} \Figures[A bar plot is shown, where values on the axis range of relative frequency from 0 to just over 0.35. The values, in decreasing order and their approximate values, are Prematurity at 0.36, Cardiovascular at 0.17, Respiratory at 0.14, Trauma at 0.11, and Neuromuscular at 0.11, Genetic/metabolic at 0.07, Immunocompromised at 0.02, and Gastrointestinal at 0.02.]{0.45}{eoce/antibiotic_use_children}{antibiotic_use_children_bar} \Figures[A pie chart is shown of the same data from a previous chart, which was a bar chart. The Prematurity category appears to represent about a third of the pie chart (though this and other proportions are difficult to estimate accurately). The Cardiovascular group is roughly one-sixth of the total pie. About a quarter of the pie consists of an even split between Respiratory and Trauma. The remaining categories represent just under a quarter of the pie: Neuromascular (about an eighth of the pie), Genetic/metabolic (about one-fifteenth of the pie), and the remainder evenly distributed between Immunocompromised and Gastrointestinal.]{0.45}{eoce/antibiotic_use_children}{antibiotic_use_children_pie} \end{center} \begin{parts} \item What features are apparent in the bar plot but not in the pie chart? \item What features are apparent in the pie chart but not in the bar plot? \item Which graph would you prefer to use for displaying these categorical data? \end{parts} }{} % 22 \eoce{\qt{Views on immigration\label{immigration}} 910 randomly sampled registered voters from Tampa, FL were asked if they thought workers who have illegally entered the US should be (i) allowed to keep their jobs and apply for US citizenship, (ii) allowed to keep their jobs as temporary guest workers but not allowed to apply for US citizenship, or (iii) lose their jobs and have to leave the country. The results of the survey by political ideology are shown below.\footfullcite{survey:immigFL:2012} \begin{center} \begin{tabular}{l l c c c c} & & \multicolumn{3}{c}{\textit{Political ideology}} \\ \cline{3-5} & & Conservative & Moderate & Liberal & Total \\ \cline{2-6} & (i) Apply for citizenship & 57 & 120 & 101 & 278 \\ & (ii) Guest worker & 121 & 113 & 28 & 262 \\ \raisebox{1.5ex}[0pt]{\emph{Response}} & (iii) Leave the country & 179 & 126 & 45 & 350 \\ & (iv) Not sure & 15 & 4 & 1 & 20\\ \cline{2-6} & Total & 372 & 363 & 175 & 910 \end{tabular} \end{center} \begin{parts} \item What percent of these Tampa, FL voters identify themselves as conservatives? \item What percent of these Tampa, FL voters are in favor of the citizenship option? \item What percent of these Tampa, FL voters identify themselves as conservatives and are in favor of the citizenship option? \item What percent of these Tampa, FL voters who identify themselves as conservatives are also in favor of the citizenship option? What percent of moderates share this view? What percent of liberals share this view? \item Do political ideology and views on immigration appear to be independent? Explain your reasoning. \end{parts} }{} \D{\newpage} % 23 \eoce{\qt{Views on the DREAM Act\label{dream_act_mosaic}} A random sample of registered voters from Tampa, FL were asked if they support the DREAM Act, a proposed law which would provide a path to citizenship for people brought illegally to the US as children. The survey also collected information on the political ideology of the respondents. Based on the mosaic plot shown below, do views on the DREAM Act and political ideology appear to be independent? Explain your reasoning. \footfullcite{survey:immigFL:2012} \begin{center} \Figures[A mosaic plot is shown. The square (or, more accurately, a rectangle in this case), is divided into three main categories as tall rectangles: Conservative (about 40\% of the data), Moderate (about 40\% of the data), and Liberal (about 20\%). The tall rectangles are each divided into "Support", "Not Support", and "Not Sure". The "Support" category is about 45-50\% for the Conservative and Moderate political groups and about 60-65\% for Liberal. The "Not Support" category is about 40-45\% for the Conservative and Moderate groups, while it is about 30\% for the Liberal group. In all three of the main groupings, "Not sure" is about the same, representing about 5-10\% of each political categories.]{0.8}{eoce/dream_act_mosaic}{dream_act_mosaic} \end{center} }{} % 24 \eoce{\qt{Raise taxes\label{raise_taxes_mosaic}} A random sample of registered voters nationally were asked whether they think it's better to raise taxes on the rich or raise taxes on the poor. The survey also collected information on the political party affiliation of the respondents. Based on the mosaic plot shown below, do views on raising taxes and political affiliation appear to be independent? Explain your reasoning. \footfullcite{survey:raiseTaxes:2015} \begin{center} \Figures[A mosaic plot is shown for variables of political affiliation (main variable split) and opinion on whether to raise taxes on the rich, poor, or not sure. The political split, representing the main vertical splits in the mosaic plot, is roughly evenly split between Democrat, Republican, and Independent/Other, with perhaps a little more respondents in the Democrat group. The very large portion of the Democrat group -- about 85\% -- overwhelmingly supports raising taxes on the rich, with only about 5\% of this group supports raising taxes on the poor, and 5\% are unsure. About 45-50\% of the Republican and Independent/Other groups each support raising taxes on the rich, about 10\% of these groups support raising taxes on the poor, and about 40-45\% of each of these groups are not sure.]{0.75}{eoce/raise_taxes_mosaic}{raise_taxes_mosaic} \end{center} }{}

    This page titled 2.2.1: Exercises (Considering Categorical Data) is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by David Diez, Christopher Barr, & Mine Çetinkaya-Rundel.

    • Was this article helpful?