Descriptive Statistics in R
- 26Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Which R package and function were used to read the OECD Excel data file?
Which R package and function were used to read the OECD Excel data file?
26 questions
- 1
Which R package and function were used to read the OECD Excel data file?
- A
The dplyr package with read_xls()
- B
The readxl package with read_xls()
- C
The readxl package with read_csv()
- D
The dplyr package with read_csv()
Correct answer
BThe readxl package with read_xls()
Explanation
The data was an Excel .xls file, so the example used readxl and its read_xls() function.
- A
- 2
Why was skip set to 3 when importing the OECD data?
- A
To shift the country names into the first three rows
- B
To read only the first three countries in the worksheet
- C
To omit the first three rows, which contained report headers
- D
To remove three decade columns from the imported data
Correct answer
CTo 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.
- A
- 3
What was the purpose of setting n_max to 42 when reading the worksheet?
- A
To retain 42 columns while discarding the country column
- B
To limit the imported data to 42 records before the footer
- C
To force every imported column to contain 42 decade values
- D
To skip 42 rows of report headers before the data
Correct answer
BTo 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.
- A
- 4
How was the country column identified for renaming in the imported data?
- A
It was the first column whose name ended in 0
- B
It was the third row containing country labels
- C
It was the final column containing numeric values
- D
It was the second column in the worksheet
Correct answer
DIt was the second column in the worksheet
Explanation
The example renamed column 2 as country because that was the column containing country names.
- A
- 5
What does selecting country and columns with names ending in 0 retain in this data set?
- A
The country field and only the 2010 column
- B
The five decade columns but not the country field
- C
All columns whose values end in the digit 0
- D
The country field and the five decade columns
Correct answer
DThe 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.
- A
- 6
After preparation, how many observations and variables were in the OECD data?
- A
42 observations and 6 variables
- B
6 observations and 42 variables
- C
42 observations and 5 variables
- D
5 observations and 42 variables
Correct answer
A42 observations and 6 variables
Explanation
The prepared data contained 42 country records and six variables: country plus five decade columns.
- A
- 7
In the example, what was the primary role of dplyr's summarize() function?
- A
To sort all records alphabetically by country
- B
To import worksheet data while skipping report headers
- C
To compute summary values, such as a maximum, mean, or count
- D
To rename columns according to their position in the data frame
Correct answer
CTo 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.
- A
- 8
Which expression calculates the highest fertility rate in the 2000 column?
- A
Filter the data with max_rate equal to mean of the 2000 column
- B
Select the 2000 column and rename its largest country
- C
Arrange the data by the 2000 column and count the records
- D
Summarize the data with max_rate equal to max of the 2000 column
Correct answer
DSummarize 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.
- A
- 9
What value did the summary report as the maximum fertility rate for 2000?
- A
1.76
- B
1.48
- C
42
- D
3.12
Correct answer
D3.12
Explanation
The maximum reported for the 2000 fertility-rate column was approximately 3.12.
- A
- 10
Why did the maximum summary alone not identify which country had the highest 2000 fertility rate?
- A
It returned a country name but removed the maximum value
- B
It returned the maximum value but not the corresponding country record
- C
It counted all records without examining the 2000 column
- D
It averaged the country names instead of the fertility rates
Correct answer
BIt 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.
- A
- 11
What did summarize() return when used to calculate the 2000 mean as a single summary?
- A
One observation containing one summary variable
- B
42 observations containing one mean per country
- C
Five observations containing one mean per decade
- D
One observation containing all 42 country records
Correct answer
AOne observation containing one summary variable
Explanation
A single summarize() calculation produced one row with one summary variable.
- A
- 12
What was the average fertility rate across the countries in 2000?
- A
1.48
- B
3.12
- C
1.76
- D
26
Correct answer
C1.76
Explanation
The mean of the values in the 2000 column was reported as 1.76.
- A
- 13
Why might filtering for records exactly equal to the column mean return no countries?
- A
Filtering cannot compare a column with a numeric summary
- B
The mean can be calculated only for text columns
- C
The calculated mean may not equal any individual observed value
- D
The mean always equals the maximum when data is numeric
Correct answer
CThe 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.
- A
- 14
What does the dplyr function n() provide in the counting example?
- A
The number of records in the data being summarized
- B
The number of missing values in a selected column
- C
The number of distinct decade columns in the data
- D
The number of countries above the column mean
Correct answer
AThe number of records in the data being summarized
Explanation
The example used n() within summarize() to count the records.
- A
- 15
What count resulted from applying n() to the selected 2000 data?
- A
6 records
- B
42 records
- C
5 records
- D
26 records
Correct answer
B42 records
Explanation
The data contained 42 country records, and the count summary returned 42.
- A
- 16
According to the lesson, how are these summary operations generally applied in a data frame?
- A
To worksheet titles, by summarizing header text
- B
To columns, by selecting variables and summarizing their values
- C
To file names, by counting characters in each name
- D
To rows, by summarizing each record across every variable
Correct answer
BTo 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.
- A
- 17
How could the country associated with the maximum 2000 value be identified after calculating the maximum?
- A
Arrange the original data by country and calculate a new mean
- B
Filter the original data for 2000 values equal to the calculated maximum
- C
Select only the maximum summary and count its columns
- D
Filter the original data for 2000 values below the calculated mean
Correct answer
BFilter 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.
- A
- 18
Which country had the maximum fertility rate in 2000 in the example?
- A
Australia
- B
Czech Republic
- C
India
- D
Russia
Correct answer
CIndia
Explanation
Filtering the data for the maximum 2000 value, approximately 3.12, identified India.
- A
- 19
Which comparison selects countries with 2000 fertility rates below the mean?
- A
The 2000 value equals the mean of the 2000 column
- B
The 2000 value is less than the mean of the 2000 column
- C
The 2000 value is less than the count of all records
- D
The 2000 value is greater than the maximum of the 2000 column
Correct answer
BThe 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.
- A
- 20
What is the effect of arranging the below-average results by the 2000 column?
- A
It orders the returned countries by their 2000 fertility-rate values
- B
It converts the country names into numeric values
- C
It changes the mean used to define below-average countries
- D
It removes countries whose rates equal the maximum
Correct answer
AIt 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.
- A
- 21
How many of the 42 countries were below the average fertility rate in 2000?
- A
16
- B
42
- C
26
- D
6
Correct answer
C26
Explanation
The below-average filter returned 26 countries out of the 42 in the data set.
- A
- 22
If a country's 2000 fertility rate is 1.48 and the mean is 1.76, how should it be classified?
- A
Equal to the maximum
- B
Below the mean
- C
Equal to the mean
- D
Above the mean
Correct answer
BBelow the mean
Explanation
Because 1.48 is less than 1.76, that country's value is below the average.
- A
- 23
What makes descriptive statistics useful across education, government, and private industry?
- A
They provide familiar summaries such as averages and record counts
- B
They identify causes for every observed difference
- C
They replace the need to organize data into columns
- D
They guarantee accurate forecasts from any data set
Correct answer
AThey 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.
- A
- 24
How can long-term fertility-rate data support policy work?
- A
It can replace all other information needed for policy decisions
- B
It can prove which individual decision caused each country's fertility rate
- C
It can show only short-term changes in a single country
- D
It can help reveal demographic trends relevant to policy outlooks and forecasting
Correct answer
DIt 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.
- A
- 25
What kind of task did the lesson describe as a common request from clients in an enterprise data science setting?
- A
Removing all observations before creating a data frame
- B
Converting every numeric column into a country name
- C
Calculating descriptive summaries such as averages, maximums, and counts
- D
Summarizing rows across variables using the demonstrated tidyverse workflow
Correct answer
CCalculating 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.
- A
- 26
Which statement best captures the lesson's guidance about tidyverse summaries across rows?
- A
The demonstrated summarize workflow operates only across rows rather than down columns
- B
The demonstrated summarize workflow operates down columns rather than across rows
- C
The demonstrated summarize workflow cannot calculate statistics from numeric columns
- D
The demonstrated summarize workflow automatically converts every row into a column
Correct answer
BThe 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.
- A

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