1. Home
  2. Explore
  3. Statistics
  4. Data Visualization with R

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Data Visualization with R

  • 73Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Titanic Dataset
The Titanic data set is useful in tutorials partly because its subject matter is familiar to a broad audience, giving everyone a shared
.

73 questions

  1. 1
    The Titanic data set is useful in tutorials partly because its subject matter is familiar to a broad audience, giving everyone a shared
    _____
    .
    Hint

    Think of the common context that helps people from different backgrounds understand the data.

    Answer

    problem domain

    Explanation

    The familiar story of the Titanic gives audiences from different industries and backgrounds a shared problem domain.

  2. 2
    The Titanic data set can serve as a proxy for
    _____
    data because its fields and imperfections resemble those found in business systems.
    Hint

    Think of the kind of information a company might use to understand its customers.

    Answer

    customer profile

    Explanation

    The presenter describes the Titanic data as a useful proxy for customer profile data, including data that may not be perfectly clean.

  3. 3
    The Titanic data set's columns that carry more than one meaning illustrate the business-data problem of
    _____
    .
    Hint

    This happens when a field is reused to represent different things over time.

    Answer

    overloaded data columns

    Explanation

    The sibsp and parch fields each combine related but distinct meanings, illustrating how business data columns can become overloaded.

  4. 4
    In the Titanic data, survived is 0 for a passenger who perished and
    _____
    for a passenger who lived.
    Hint

    It is the other value of this binary indicator.

    Answer

    1

    Explanation

    The survived variable is a binary indicator: 0 means the passenger perished, while 1 means the passenger survived.

  5. 5
    The pclass variable records a passenger's ticket class, which indicates their level of
    _____
    aboard the ship.
    Hint

    It describes the type or level of a passenger's onboard arrangements.

    Answer

    accommodations

    Explanation

    First, second, and third class distinguish passengers' levels of accommodations on the Titanic.

  6. 6
    Unlike survived or pclass, age is described as a
    _____
    variable because it is numeric and can include decimal values.
    Hint

    This kind of variable can take numeric values across a range rather than just categories.

    Answer

    continuous

    Explanation

    Age is continuous numeric data; the data may include values such as 33.44 years.

  7. 7
    The sibsp field can count siblings traveling with a passenger, a traveling spouse, or a
    _____
    of both.
    Hint

    The field's meaning can include both types of family members at once.

    Answer

    combination

    Explanation

    Sibsp is overloaded because it may represent siblings, a spouse, or siblings and a spouse together.

  8. 8
    The parch field can count a passenger's traveling parents, children, or
    _____
    .
    Hint

    The field may include the two family relationships together.

    Answer

    both

    Explanation

    Parch is overloaded because it may refer to parents, children, or both traveling aboard the Titanic.

  9. 9
    The ticket field contains the passenger's ticket
    _____
    .
    Hint

    It identifies the particular ticket rather than describing the passenger's fare or class.

    Answer

    serial number

    Explanation

    The ticket column records the serial number of a passenger's Titanic ticket.

  10. 10
    The fare field records the amount paid for a ticket in
    _____
    .
    Hint

    This is the currency named in the data description.

    Answer

    pound sterling

    Explanation

    Fare represents how much a passenger paid for the ticket, measured in pound sterling.

  11. 11
    A cabin value is present only for passengers who had a
    _____
    assigned to them.
    Hint

    It identifies a passenger's assigned onboard room.

    Answer

    cabin number

    Explanation

    Not every passenger had a cabin number assigned; when one was assigned, it was recorded in the cabin column.

  12. 12
    The embarked field identifies the port of
    _____
    where a passenger boarded the ship.
    Hint

    It is the location where the passenger got on the ship.

    Answer

    embarkation

    Explanation

    The embarked column records the passenger's port of embarkation, using codes for Cherbourg, Queenstown, and Southampton.

  13. 13
    In the embarked codes, C, Q, and S stand for Cherbourg, Queenstown, and
    _____
    .
    Hint

    It is the port represented by the final letter in that list.

    Answer

    Southampton

    Explanation

    The data uses C for Cherbourg, Q for Queenstown, and S for Southampton.

  14. 14
    The name ggplot2 refers to the
    _____
    that inspired its approach to data visualization.
    Hint

    The concept treats visualization as a structured visual language.

    Answer

    grammar of graphics

    Explanation

    The gg in ggplot2 comes from the grammar of graphics, the framework that informs the package's visualization approach.

  15. 15
    In R, ggplot2 is widely regarded as a
    _____
    visualization tool.
    Hint

    This phrase describes a tool that is accepted in practice as the standard.

    Answer

    de facto standard

    Explanation

    The tutorial characterizes ggplot2 as the de facto standard visualization tool in R.

  16. 16
    A major advantage of ggplot2 is that it can create high-quality graphics with very few
    _____
    .
    Hint

    Think of how much typing is required to produce a graphic.

    Answer

    keystrokes

    Explanation

    The tutorial emphasizes that ggplot2 can create print-quality graphics in seconds with few keystrokes.

  17. 17
    For detailed customization, ggplot2 provides an API that lets users build visualizations by
    _____
    aspects of a visual grammar.
    Hint

    The process involves adding visual components in successive parts.

    Answer

    layering

    Explanation

    The ggplot2 API supports fine-grained control by layering aspects of the visual grammar to shape the final graphic.

  18. 18
    In the grammar of graphics, the raw material used to make a visualization is the
    _____
    .
    Hint

    A plot cannot be produced without this input.

    Answer

    data

    Explanation

    Data is the raw material for a visualization; without data, there is no visualization to create.

  19. 19
    In ggplot2, points, lines, and bars that appear in a visualization are examples of
    _____
    .
    Hint

    They are the visible components drawn on the graphic.

    Answer

    layers

    Explanation

    Layers are the visible elements of a visualization, such as points, lines, and bars.

  20. 20
    In the grammar of graphics,
    _____
    map or transform data values so they fit the available graphical space.
    Hint

    They help translate data values into a display with limited screen area.

    Answer

    scales

    Explanation

    Scales shrink or otherwise map data values so they can be represented consistently in the limited space of a graphic.

  21. 21
    The default perspective used for many ggplot2 charts is a two-dimensional
    _____
    .
    Hint

    It is the familiar arrangement with horizontal and vertical axes.

    Answer

    grid

    Explanation

    The default coordinate system is a two-dimensional grid, or XY plane, used for common charts such as bars and lines.

  22. 22
    In ggplot2, faceting creates visual
    _____
    by dividing a display into panels for subsets of the data.
    Hint

    It lets viewers inspect the data at more specific groupings.

    Answer

    drill down

    Explanation

    Faceting provides visual drill down by displaying subsets of the data in separate panels.

  23. 23
    In ggplot2,
    _____
    control display details such as fonts, font sizes, and color schemes.
    Hint

    They customize the look and feel rather than the underlying data.

    Answer

    themes

    Explanation

    Themes provide fine-grained control over display details, including fonts, sizes, and color schemes.

  24. 24
    Although ggplot2 offers many customization options, its
    _____
    often work well enough to get started.
    Hint

    These are the settings the package supplies automatically.

    Answer

    defaults

    Explanation

    The tutorial notes that users often do not need to customize every part of the grammar because the defaults work well out of the box.

  25. 25
    The three essentials for creating a basic ggplot2 graphic are data, an aesthetic mapping, and a
    _____
    .
    Hint

    It specifies what kind of visible mark, such as bars, should be drawn.

    Answer

    layer

    Explanation

    A basic ggplot2 visualization needs data, an aesthetic mapping, and a layer that defines what to display.

  26. 26
    An aesthetic mapping connects data variables to visual properties, such as assigning age to the
    _____
    .
    Hint

    It is one of the two axes in a typical two-dimensional chart.

    Answer

    y-axis

    Explanation

    An aesthetic mapping tells ggplot2 how to map data to the display; for example, age can be mapped to the y-axis.

  27. 27
    A bar chart is especially suitable for categorical data because it displays
    _____
    .
    Hint

    It summarizes how many observations fall in each category.

    Answer

    counts

    Explanation

    A bar chart is a useful way to show categorical data because it represents the count in each category.

  28. 28
    In the Titanic analysis, passenger ID is ignored because it is a unique identifier with no useful analytical
    _____
    in its current form.
    Hint

    It does not distinguish passengers in a way that explains the outcome.

    Answer

    signal

    Explanation

    Passenger ID functions like a primary key, but its unique sequential values do not provide useful analytical signal for this analysis.

  29. 29
    The passenger names are not used as-is because all 891 are unique, although text analytics could potentially extract
    _____
    from them.
    Hint

    It is information that may help explain a pattern in the outcome.

    Answer

    signal

    Explanation

    Names have no analytical signal in their current form because they are all unique, though text analytics or regular expressions might reveal information.

  30. 30
    Before plotting survived, the analyst treats it as a
    _____
    rather than as a numeric measurement.
    Hint

    This R data type represents categories.

    Answer

    factor

    Explanation

    Survived indicates membership in one of two categories, so it should be treated as a factor rather than used for arithmetic.

  31. 31
    Although pclass contains the numbers 1, 2, and 3, it is treated as a
    _____
    because the values represent ticket categories.
    Hint

    The values label classes rather than quantities suitable for multiplication or division.

    Answer

    factor

    Explanation

    Pclass is categorical: class 3 is not three times class 1, so pclass should be represented as a factor.

  32. 32
    The sex column should be represented as a factor because it consists of the categories male and
    _____
    .
    Hint

    It is the other category in the two-value field.

    Answer

    female

    Explanation

    Sex is categorical string data with the values male and female, so it is appropriate to treat it as a factor.

  33. 33
    The embarked column should be a factor because its values identify distinct
    _____
    rather than numeric measurements.
    Hint

    The values correspond to Cherbourg, Queenstown, and Southampton.

    Answer

    ports

    Explanation

    Embarked contains categories for the ports of Cherbourg, Queenstown, and Southampton, so it should be treated as a factor.

  34. 34
    Treating categorical variables as factors allows ggplot2 to use them in aesthetic mappings, including for
    _____
    .
    Hint

    This visual technique assigns different colors to categories.

    Answer

    color coding

    Explanation

    When factor variables are used in ggplot2 aesthetic mappings, they can support useful displays such as color-coded visualizations.

  35. 35
    The Titanic data used in the tutorial contains 891 observations and
    _____
    columns.
    Hint

    The column count is a dozen.

    Answer

    12

    Explanation

    The data frame shown in the tutorial contains 891 observations and 12 columns.

  36. 36
    The age column contains missing observations, so a plot of age may need to proceed without some rows of
    _____
    .
    Hint

    It is what the missing values would otherwise contribute to the plot.

    Answer

    data

    Explanation

    Some passengers have no recorded age, meaning age-based visualizations cannot include those missing observations as measured values.

  37. 37
    The analysis aims to use the Titanic data to explain patterns of passenger
    _____
    .
    Hint

    The central outcome is whether passengers lived or perished.

    Answer

    survival

    Explanation

    The consulting analysis is framed around explaining who survived, who died, and what patterns in the data are associated with the outcome.

  38. 38
    Because the intended audience is not data savvy, the presenter favors intuitive visualizations over leading with complicated mathematical representations or
    _____
    .
    Hint

    These are numerical summaries that may be less immediately intuitive to a general audience.

    Answer

    summary statistics

    Explanation

    For a non-data-savvy audience, intuitive visuals can make patterns easier to recognize than summary statistics or complicated mathematical representations.

  39. 39
    The hypothesis that women and children were prioritized suggests examining survival in relation to
    _____
    and age.
    Hint

    It is the other demographic factor named in the hypothesis.

    Answer

    gender

    Explanation

    The women-and-children-first hypothesis connects survival to both gender and age.

  40. 40
    A useful first question when beginning the survival analysis is the overall
    _____
    rate.
    Hint

    It describes the share of passengers who lived.

    Answer

    survival

    Explanation

    The analysis first establishes the overall survival rate to give context for later comparisons.

  41. 41
    After finding a relationship with gender, the analyst considers ticket class as another possible
    _____
    of survival.
    Hint

    It may help explain differences in the outcome.

    Answer

    factor

    Explanation

    The analysis asks whether ticket class, in addition to gender, may have influenced or been associated with survival.

  42. 42
    A proposed explanation for better survival in higher ticket classes is that passengers may have been closer to the
    _____
    .
    Hint

    These were essential for escaping the sinking ship.

    Answer

    lifeboats

    Explanation

    The tutorial proposes that higher-class accommodations may have been closer to lifeboats, potentially contributing to survival differences.

  43. 43
    A bar chart mapped to survived shows the overall counts of passengers who perished and
    _____
    .
    Hint

    It is the outcome represented by the other category in the chart.

    Answer

    survived

    Explanation

    Mapping survived to the horizontal axis and adding a bar layer displays counts for passengers who perished and passengers who survived.

  44. 44
    The tutorial estimates that about 62% of the Titanic passengers in the data
    _____
    .
    Hint

    This is the larger of the two outcome groups in the overall survival chart.

    Answer

    perished

    Explanation

    The overall proportions are described as approximately 62% perished and 38% survived.

  45. 45
    To compare survival outcomes within gender categories, the plot maps sex to the x-axis and survived to the
    _____
    aesthetic.
    Hint

    This aesthetic colors the portions of the bars by outcome.

    Answer

    fill

    Explanation

    Mapping survived to fill color-codes each gender bar by whether passengers perished or survived.

  46. 46
    The gender comparison shows that females survived
    _____
    more often than males.
    Hint

    The difference is more than a small or even split between the groups.

    Answer

    disproportionately

    Explanation

    The color-coded gender bars show substantially higher survival among females than among males.

  47. 47
    The gender chart also suggests that there were approximately twice as many males as females, or about a
    _____
    ratio.
    Hint

    The first number is about double the second.

    Answer

    two to one

    Explanation

    The chart suggests roughly twice as many male passengers as female passengers, an approximately two-to-one ratio.

  48. 48
    To compare outcomes across ticket classes, the class variable is mapped to the
    _____
    axis.
    Hint

    It is the horizontal axis in the chart.

    Answer

    x

    Explanation

    The class visualization maps pclass to the horizontal axis and uses fill to show survival outcomes.

  49. 49
    The class comparison shows a general decline in survival as passengers move from first class toward
    _____
    class.
    Hint

    It is the lowest ticket class represented in the analysis.

    Answer

    third

    Explanation

    The visualization shows survival declining from first class through second class to third class.

  50. 50
    In the class comparison, more than half of first-class passengers survived, while the estimated survival rate in third class was about
    _____
    .
    Hint

    This is approximately one passenger in four.

    Answer

    25%

    Explanation

    The plot suggests that more than half of first-class passengers survived, compared with about one quarter of third-class passengers.

  51. 51
    The passenger counts by class were not simply ordered from most to fewest: second class had fewer passengers than both first and
    _____
    class.
    Hint

    It is the remaining class with a larger count than second class.

    Answer

    third

    Explanation

    The chart shows fewer second-class passengers than either first- or third-class passengers.

  52. 52
    The labs function can be used to change axis labels and add a plot
    _____
    .
    Hint

    This text names the overall graphic.

    Answer

    title

    Explanation

    The labs function modifies axis and legend labels and can set the title of a plot.

  53. 53
    The tutorial changes the default gray plot background to a clean
    _____
    background.
    Hint

    It is the lighter background color preferred by the presenter.

    Answer

    white

    Explanation

    The presenter uses a theme that replaces ggplot2's default gray background with a white one.

  54. 54
    A faceted gender-and-class bar chart places each ticket class in its own
    _____
    .
    Hint

    It is one of the separate sections in a faceted display.

    Answer

    panel

    Explanation

    Faceting by pclass creates separate panels for first, second, and third class, each showing gender categories.

  55. 55
    For an age distribution, a histogram uses age on an axis and groups numeric values into
    _____
    .
    Hint

    These are intervals that collect values into ranges.

    Answer

    bins

    Explanation

    A histogram groups numeric data into bins and displays the counts in those intervals.

  56. 56
    The tutorial sets the histogram bin width to five years, so each interval spans
    _____
    years.
    Hint

    This is the chosen width of each age interval.

    Answer

    five

    Explanation

    The example uses a bin width of five years to group passenger ages into five-year intervals.

  57. 57
    Changing a histogram's bin width changes the plot's visual
    _____
    .
    Hint

    It is the overall form that viewers see in the histogram.

    Answer

    shape

    Explanation

    The appearance of a histogram depends on the bin width, so different widths can produce different visual shapes.

  58. 58
    Because the default bin width may not be optimal, the analyst should compare widths and choose one that is reasonable for the
    _____
    .
    Hint

    The best choice depends on the values being summarized.

    Answer

    data

    Explanation

    The tutorial recommends trying different bin widths because the default may not communicate the structure of the data well.

  59. 59
    When ggplot2 encounters missing ages while making a histogram, it can remove those values and plot the remaining
    _____
    .
    Hint

    They are the recorded ages available to the plot.

    Answer

    values

    Explanation

    ggplot2 can omit missing age observations and create the histogram using the available values, while issuing a warning.

  60. 60
    The age histogram shows that many passengers were between 20 and
    _____
    years old.
    Hint

    This is the upper end of the range containing a large concentration of passengers.

    Answer

    40

    Explanation

    The tutorial describes a large concentration of passengers in the 20-to-40 age range.

  61. 61
    The age distribution has a long tail toward older passengers, with the oldest age shown at about
    _____
    years.
    Hint

    It is the approximate maximum age noted in the discussion.

    Answer

    80

    Explanation

    The histogram shows a long right tail and includes passengers as old as about 80.

  62. 62
    A histogram with survived mapped to fill shows the relative survival outcomes within each age
    _____
    .
    Hint

    It is one of the age intervals represented by a bar.

    Answer

    bin

    Explanation

    Coloring histogram bars by survived allows comparison of the proportions who lived and perished in each age bin.

  63. 63
    The filled age histogram suggests that young children survived
    _____
    often than many older passengers.
    Hint

    Their survival share is notably higher relative to the group.

    Answer

    disproportionately

    Explanation

    The tutorial notes that younger children appear to have survived at disproportionately high rates, supporting the children-first hypothesis.

  64. 64
    A box-and-whisker plot compares survived on the x-axis with age on the
    _____
    axis.
    Hint

    It is the vertical axis in the example.

    Answer

    y

    Explanation

    The box-and-whisker plot maps survival status horizontally and passenger age vertically.

  65. 65
    The box-and-whisker plot suggests that passengers who survived tended to be
    _____
    than those who perished.
    Hint

    Their age distribution is shifted slightly toward the lower end.

    Answer

    younger

    Explanation

    The age distributions indicate that survivors tended to be somewhat younger, although the difference is not large.

  66. 66
    Using both a histogram and a box-and-whisker plot helps provide a more complete view by examining data through multiple
    _____
    .
    Hint

    These are different graphical ways of inspecting the same data.

    Answer

    visualizations

    Explanation

    The tutorial recommends using multiple visualizations because each can reveal different aspects of the data.

  67. 67
    A density plot is analogous to a histogram, but its displayed shape is
    _____
    .
    Hint

    It replaces the jagged appearance of separate bars with a continuous-looking curve.

    Answer

    smoothed

    Explanation

    Density plots communicate information similar to histograms using smoothed shapes rather than squared-off bars.

  68. 68
    In the density plot, an alpha value of 0.5 makes the plotted shapes
    _____
    .
    Hint

    This allows viewers to see overlapping areas.

    Answer

    transparent

    Explanation

    Alpha controls transparency; an alpha value of 0.5 lets viewers see through overlapping density shapes.

  69. 69
    Faceting the age display by both sex and pclass lets the analyst compare age and survival across four pieces of
    _____
    .
    Hint

    These are the variables considered together in the analysis.

    Answer

    data

    Explanation

    The faceted view combines age, sex, pclass, and survival status to examine how the variables relate.

  70. 70
    The density plot discussion highlights that the youngest children in second class, including both girls and boys,
    _____
    .
    Hint

    Their outcome is shown by the survival-colored portion of the plot.

    Answer

    survived

    Explanation

    The tutorial interprets the second-class density panels as showing that the youngest children of both genders survived.

  71. 71
    The faceted age plots suggest that survival depends not on age alone, but on age combined with gender and
    _____
    .
    Hint

    This ticket-related variable is the third factor in the comparison.

    Answer

    pclass

    Explanation

    The tutorial emphasizes that the combination of age, gender, and pclass provides a more informative survival pattern than age alone.

  72. 72
    The histogram-based faceted comparison indicates that girls in third class also
    _____
    disproportionately.
    Hint

    Their outcome was more favorable than a simple even split might suggest.

    Answer

    survived

    Explanation

    The tutorial revises its initial interpretation after examining the histograms, noting that girls in third class also survived disproportionately.

  73. 73
    The faceted views show especially poor survival for older males in
    _____
    class.
    Hint

    It is the lowest ticket class in the comparison.

    Answer

    third

    Explanation

    The tutorial observes especially low survival among older males in third class.

1 of 73
Question 1 of 73

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent