1. Home
  2. Explore
  3. Statistics
  4. Descriptive Statistics in R

Study methods

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

Descriptive Statistics in R

  • 26Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Data Preparation

Which R package and function were used to read the OECD Excel data file?

26 questions

  1. 1

    Which R package and function were used to read the OECD Excel data file?

    1. A

      The dplyr package with read_xls()

    2. B

      The readxl package with read_xls()

    3. C

      The readxl package with read_csv()

    4. D

      The dplyr package with read_csv()

    Correct answer
    B

    The readxl package with read_xls()

    Explanation

    The data was an Excel .xls file, so the example used readxl and its read_xls() function.

  2. 2

    Why was skip set to 3 when importing the OECD data?

    1. A

      To shift the country names into the first three rows

    2. B

      To read only the first three countries in the worksheet

    3. C

      To omit the first three rows, which contained report headers

    4. D

      To remove three decade columns from the imported data

    Correct answer
    C

    To omit the first three rows, which contained report headers

    Explanation

    The first three rows contained headers in the Excel report rather than the data to analyze.

  3. 3

    What was the purpose of setting n_max to 42 when reading the worksheet?

    1. A

      To retain 42 columns while discarding the country column

    2. B

      To limit the imported data to 42 records before the footer

    3. C

      To force every imported column to contain 42 decade values

    4. D

      To skip 42 rows of report headers before the data

    Correct answer
    B

    To limit the imported data to 42 records before the footer

    Explanation

    The worksheet contained footer material, and n_max = 42 limited the import to the 42 data records.

  4. 4

    How was the country column identified for renaming in the imported data?

    1. A

      It was the first column whose name ended in 0

    2. B

      It was the third row containing country labels

    3. C

      It was the final column containing numeric values

    4. D

      It was the second column in the worksheet

    Correct answer
    D

    It was the second column in the worksheet

    Explanation

    The example renamed column 2 as country because that was the column containing country names.

  5. 5

    What does selecting country and columns with names ending in 0 retain in this data set?

    1. A

      The country field and only the 2010 column

    2. B

      The five decade columns but not the country field

    3. C

      All columns whose values end in the digit 0

    4. D

      The country field and the five decade columns

    Correct answer
    D

    The country field and the five decade columns

    Explanation

    The decade names—1970, 1980, 1990, 2000, and 2010—all end in 0, so the selection retains those five columns along with country.

  6. 6

    After preparation, how many observations and variables were in the OECD data?

    1. A

      42 observations and 6 variables

    2. B

      6 observations and 42 variables

    3. C

      42 observations and 5 variables

    4. D

      5 observations and 42 variables

    Correct answer
    A

    42 observations and 6 variables

    Explanation

    The prepared data contained 42 country records and six variables: country plus five decade columns.

  7. 7

    In the example, what was the primary role of dplyr's summarize() function?

    1. A

      To sort all records alphabetically by country

    2. B

      To import worksheet data while skipping report headers

    3. C

      To compute summary values, such as a maximum, mean, or count

    4. D

      To rename columns according to their position in the data frame

    Correct answer
    C

    To compute summary values, such as a maximum, mean, or count

    Explanation

    The example used summarize() to calculate descriptive values including a maximum, an average, and a record count.

  8. 8

    Which expression calculates the highest fertility rate in the 2000 column?

    1. A

      Filter the data with max_rate equal to mean of the 2000 column

    2. B

      Select the 2000 column and rename its largest country

    3. C

      Arrange the data by the 2000 column and count the records

    4. D

      Summarize the data with max_rate equal to max of the 2000 column

    Correct answer
    D

    Summarize the data with max_rate equal to max of the 2000 column

    Explanation

    Applying max() to the 2000 column within summarize() returns its highest fertility-rate value.

  9. 9

    What value did the summary report as the maximum fertility rate for 2000?

    1. A

      1.76

    2. B

      1.48

    3. C

      42

    4. D

      3.12

    Correct answer
    D

    3.12

    Explanation

    The maximum reported for the 2000 fertility-rate column was approximately 3.12.

  10. 10

    Why did the maximum summary alone not identify which country had the highest 2000 fertility rate?

    1. A

      It returned a country name but removed the maximum value

    2. B

      It returned the maximum value but not the corresponding country record

    3. C

      It counted all records without examining the 2000 column

    4. D

      It averaged the country names instead of the fertility rates

    Correct answer
    B

    It returned the maximum value but not the corresponding country record

    Explanation

    The summarized result contained one value for the maximum, so a separate filter was needed to find the record and country associated with it.

  11. 11

    What did summarize() return when used to calculate the 2000 mean as a single summary?

    1. A

      One observation containing one summary variable

    2. B

      42 observations containing one mean per country

    3. C

      Five observations containing one mean per decade

    4. D

      One observation containing all 42 country records

    Correct answer
    A

    One observation containing one summary variable

    Explanation

    A single summarize() calculation produced one row with one summary variable.

  12. 12

    What was the average fertility rate across the countries in 2000?

    1. A

      1.48

    2. B

      3.12

    3. C

      1.76

    4. D

      26

    Correct answer
    C

    1.76

    Explanation

    The mean of the values in the 2000 column was reported as 1.76.

  13. 13

    Why might filtering for records exactly equal to the column mean return no countries?

    1. A

      Filtering cannot compare a column with a numeric summary

    2. B

      The mean can be calculated only for text columns

    3. C

      The calculated mean may not equal any individual observed value

    4. D

      The mean always equals the maximum when data is numeric

    Correct answer
    C

    The calculated mean may not equal any individual observed value

    Explanation

    A mean is an aggregate value and is not necessarily present among the individual observations, so exact equality may match no records.

  14. 14

    What does the dplyr function n() provide in the counting example?

    1. A

      The number of records in the data being summarized

    2. B

      The number of missing values in a selected column

    3. C

      The number of distinct decade columns in the data

    4. D

      The number of countries above the column mean

    Correct answer
    A

    The number of records in the data being summarized

    Explanation

    The example used n() within summarize() to count the records.

  15. 15

    What count resulted from applying n() to the selected 2000 data?

    1. A

      6 records

    2. B

      42 records

    3. C

      5 records

    4. D

      26 records

    Correct answer
    B

    42 records

    Explanation

    The data contained 42 country records, and the count summary returned 42.

  16. 16

    According to the lesson, how are these summary operations generally applied in a data frame?

    1. A

      To worksheet titles, by summarizing header text

    2. B

      To columns, by selecting variables and summarizing their values

    3. C

      To file names, by counting characters in each name

    4. D

      To rows, by summarizing each record across every variable

    Correct answer
    B

    To columns, by selecting variables and summarizing their values

    Explanation

    The lesson emphasized selecting columns and calculating summaries down those columns, rather than summarizing across rows.

  17. 17

    How could the country associated with the maximum 2000 value be identified after calculating the maximum?

    1. A

      Arrange the original data by country and calculate a new mean

    2. B

      Filter the original data for 2000 values equal to the calculated maximum

    3. C

      Select only the maximum summary and count its columns

    4. D

      Filter the original data for 2000 values below the calculated mean

    Correct answer
    B

    Filter the original data for 2000 values equal to the calculated maximum

    Explanation

    The maximum value can be used as a filter condition on the original 2000 column to retrieve the matching country record.

  18. 18

    Which country had the maximum fertility rate in 2000 in the example?

    1. A

      Australia

    2. B

      Czech Republic

    3. C

      India

    4. D

      Russia

    Correct answer
    C

    India

    Explanation

    Filtering the data for the maximum 2000 value, approximately 3.12, identified India.

  19. 19

    Which comparison selects countries with 2000 fertility rates below the mean?

    1. A

      The 2000 value equals the mean of the 2000 column

    2. B

      The 2000 value is less than the mean of the 2000 column

    3. C

      The 2000 value is less than the count of all records

    4. D

      The 2000 value is greater than the maximum of the 2000 column

    Correct answer
    B

    The 2000 value is less than the mean of the 2000 column

    Explanation

    To find countries below average, the example compared each 2000 value with the column mean using a less-than condition.

  20. 20

    What is the effect of arranging the below-average results by the 2000 column?

    1. A

      It orders the returned countries by their 2000 fertility-rate values

    2. B

      It converts the country names into numeric values

    3. C

      It changes the mean used to define below-average countries

    4. D

      It removes countries whose rates equal the maximum

    Correct answer
    A

    It orders the returned countries by their 2000 fertility-rate values

    Explanation

    The arrange() step orders the filtered records by their values in the 2000 column.

  21. 21

    How many of the 42 countries were below the average fertility rate in 2000?

    1. A

      16

    2. B

      42

    3. C

      26

    4. D

      6

    Correct answer
    C

    26

    Explanation

    The below-average filter returned 26 countries out of the 42 in the data set.

  22. 22

    If a country's 2000 fertility rate is 1.48 and the mean is 1.76, how should it be classified?

    1. A

      Equal to the maximum

    2. B

      Below the mean

    3. C

      Equal to the mean

    4. D

      Above the mean

    Correct answer
    B

    Below the mean

    Explanation

    Because 1.48 is less than 1.76, that country's value is below the average.

  23. 23

    What makes descriptive statistics useful across education, government, and private industry?

    1. A

      They provide familiar summaries such as averages and record counts

    2. B

      They identify causes for every observed difference

    3. C

      They replace the need to organize data into columns

    4. D

      They guarantee accurate forecasts from any data set

    Correct answer
    A

    They provide familiar summaries such as averages and record counts

    Explanation

    The lesson noted that averages and counts are commonly used and widely understood in many kinds of organizations.

  24. 24

    How can long-term fertility-rate data support policy work?

    1. A

      It can replace all other information needed for policy decisions

    2. B

      It can prove which individual decision caused each country's fertility rate

    3. C

      It can show only short-term changes in a single country

    4. D

      It can help reveal demographic trends relevant to policy outlooks and forecasting

    Correct answer
    D

    It can help reveal demographic trends relevant to policy outlooks and forecasting

    Explanation

    The lesson described fertility rates as a useful metric for examining long-term demographic trends, policy outlooks, and forecasting.

  25. 25

    What kind of task did the lesson describe as a common request from clients in an enterprise data science setting?

    1. A

      Removing all observations before creating a data frame

    2. B

      Converting every numeric column into a country name

    3. C

      Calculating descriptive summaries such as averages, maximums, and counts

    4. D

      Summarizing rows across variables using the demonstrated tidyverse workflow

    Correct answer
    C

    Calculating descriptive summaries such as averages, maximums, and counts

    Explanation

    The lesson emphasized that requests for common summary statistics are typical work in data science organizations.

  26. 26

    Which statement best captures the lesson's guidance about tidyverse summaries across rows?

    1. A

      The demonstrated summarize workflow operates only across rows rather than down columns

    2. B

      The demonstrated summarize workflow operates down columns rather than across rows

    3. C

      The demonstrated summarize workflow cannot calculate statistics from numeric columns

    4. D

      The demonstrated summarize workflow automatically converts every row into a column

    Correct answer
    B

    The demonstrated summarize workflow operates down columns rather than across rows

    Explanation

    The lesson stated that the tidyverse workflow being demonstrated summarized down columns, not across rows.

Question 1 of 26
Question 1 of 26

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent