R Statistics and Machine Learning
- 84Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Why does using a programming script support reproducible research?
Why does using a programming script support reproducible research?
84 questions
- 1
Why does using a programming script support reproducible research?
- A
It guarantees that every dataset will produce the same result, regardless of its contents.
- B
It automatically corrects errors in the data before any analysis begins.
- C
It records the steps used to process data and produce results, so they can be run again.
- D
It replaces the need to document the methods used in a research project.
Correct answer
CIt records the steps used to process data and produce results, so they can be run again.
Explanation
A script makes data-processing and analysis steps explicit, allowing the workflow to be rerun and inspected.
- A
- 2
What is a key advantage of automating an analysis with code rather than repeating menu selections?
- A
Code makes it unnecessary to check whether the input data are appropriate.
- B
Code ensures that complex statistical methods no longer require decisions by the researcher.
- C
Code can rerun a sequence of preprocessing, analysis, and graphing steps without repeating each click.
- D
Code limits analyses to methods that are available in a software menu.
Correct answer
CCode can rerun a sequence of preprocessing, analysis, and graphing steps without repeating each click.
Explanation
A programmed workflow can automate repeated operations, such as running the same analysis for different data subsets.
- A
- 3
How can scripts improve communication about an analysis?
- A
They expose the operations performed, making it easier for others to inspect or rerun them.
- B
They convert every analytical decision into a universally accepted interpretation.
- C
They remove the need to share data or explain the research question.
- D
They ensure that readers will agree with the conclusions.
Correct answer
AThey expose the operations performed, making it easier for others to inspect or rerun them.
Explanation
A script provides a record of what was done to the data and how results were produced, which can help others review the method.
- A
- 4
What does it mean that R is open source?
- A
R can only be used when a user has an internet connection.
- B
People can contribute to the development of R and its associated tools.
- C
R makes all analyses public as soon as they are run.
- D
Every package for R is automatically installed with the language.
Correct answer
BPeople can contribute to the development of R and its associated tools.
Explanation
The workshop describes open source as allowing people to contribute to R.
- A
- 5
Why might a researcher choose R instead of a costly licensed statistics program?
- A
R is free to use, which avoids the expense of purchasing a student license.
- B
R is available only to researchers at academic institutions.
- C
R guarantees that analyses will be statistically significant.
- D
R requires no programming and only uses graphical menus.
Correct answer
AR is free to use, which avoids the expense of purchasing a student license.
Explanation
The workshop contrasts R's free availability with the cost of licenses for some statistical software.
- A
- 6
How can R's large user community benefit someone learning the language?
- A
The community ensures that every online answer is correct for every situation.
- B
Users can often find online discussions and solutions to problems others have encountered.
- C
The community automatically runs analyses on a learner's computer.
- D
Users no longer need to learn how packages or functions work.
Correct answer
BUsers can often find online discussions and solutions to problems others have encountered.
Explanation
A large community can provide support and share packages, methods, and solutions to common problems.
- A
- 7
What does R's extensibility allow a user to do?
- A
Avoid specifying what an analysis should do.
- B
Convert every analysis into a graphical menu automatically.
- C
Run R scripts only on the computer where they were written.
- D
Add functions or implement algorithms for a particular project.
Correct answer
DAdd functions or implement algorithms for a particular project.
Explanation
R can be extended with user-written functions and algorithms, as well as packages contributed by others.
- A
- 8
Why can running R on Mac, Windows, and Linux support collaborative analysis?
- A
Different operating systems eliminate the need to share scripts.
- B
R scripts require all collaborators to use the same computer.
- C
Researchers using different operating systems can use the same language to run analyses.
- D
The operating systems automatically produce identical research conclusions.
Correct answer
CResearchers using different operating systems can use the same language to run analyses.
Explanation
R is available on multiple operating systems, allowing researchers on those platforms to work with the same programming language.
- A
- 9
Why did the workshop presenter consider R suitable for a statistics-focused workshop?
- A
R is the only programming language capable of processing data.
- B
R was designed specifically for statistical purposes.
- C
R can perform statistical analysis only through a graphical interface.
- D
R does not allow users to write or customize functions.
Correct answer
BR was designed specifically for statistical purposes.
Explanation
The presenter identified R as a language specifically written for statistics, making it suitable for the workshop's analysis needs.
- A
- 10
What is the main role of RStudio in the workshop's setup?
- A
It is a data package that must be loaded before every R calculation.
- B
It provides an integrated development environment for working with R scripts and commands.
- C
It replaces R with a different statistical programming language.
- D
It automatically selects the correct statistical model for any dataset.
Correct answer
BIt provides an integrated development environment for working with R scripts and commands.
Explanation
RStudio is an integrated development environment that brings tools such as a script editor, console, workspace, and output panes together.
- A
- 11
Which description best distinguishes RStudio's text editor from its console?
- A
The editor runs commands automatically, while the console is only for writing comments.
- B
The editor stores variables, while the console displays installed packages only.
- C
The editor displays plots, while the console edits the operating system's files.
- D
The editor is for writing script text, while the console is for entering R commands.
Correct answer
DThe editor is for writing script text, while the console is for entering R commands.
Explanation
The text editor is used to write scripts, whereas the console accepts commands in the R language.
- A
- 12
What does the R expression 14 + 3 return when entered in the console?
- A
A logical value indicating whether 14 equals 3.
- B
The numeric result 17.
- C
A new variable named 17.
- D
A character string containing "14 + 3".
Correct answer
BThe numeric result 17.
Explanation
R can act as a calculator; adding 14 and 3 returns 17.
- A
- 13
What is the result of the R expression 3 ^ 3?
- A
9
- B
81
- C
6
- D
27
Correct answer
D27
Explanation
In R, the caret performs exponentiation, so 33=27.
- A
- 14
What kind of result does an equality test such as 50 == 50 + 1 produce?
- A
A vector containing the two numbers being compared.
- B
A logical value indicating whether the two sides are equal.
- C
A numeric value equal to the sum of the two sides.
- D
A character string containing both sides of the comparison.
Correct answer
BA logical value indicating whether the two sides are equal.
Explanation
The equality operator compares the expressions on its two sides and returns a logical result, here FALSE.
- A
- 15
What happens when a value is assigned to a variable using R's assignment operator?
- A
The value is stored under the variable name for later use.
- B
The value is removed from the current R session.
- C
The value is always printed as the only output of the assignment.
- D
The variable name is converted into a function automatically.
Correct answer
AThe value is stored under the variable name for later use.
Explanation
Assignment stores information in a variable; the assignment itself does not necessarily print the value in the console.
- A
- 16
What does c() do when used to create an R variable such as c(177, 156, 189, 200)?
- A
It arranges the values into a data frame with named columns.
- B
It combines the supplied values into a vector.
- C
It converts each supplied value into a separate function.
- D
It removes any repeated values from the input.
Correct answer
BIt combines the supplied values into a vector.
Explanation
The c() function combines values into a vector.
- A
- 17
Which description best defines a vector as presented in the workshop?
- A
A table that must contain both rows and columns.
- B
A single variable containing values of the same data type.
- C
A variable that can contain only one value.
- D
A collection of functions with different input arguments.
Correct answer
BA single variable containing values of the same data type.
Explanation
A vector stores multiple values of the same type in one variable.
- A
- 18
What is the main difference between a list and a vector in the examples?
- A
A list must be rectangular, while a vector must have named rows.
- B
A list stores functions only, while a vector stores data only.
- C
A list can contain only numbers, while a vector can contain only text.
- D
A list can combine vectors of different types, while a vector holds values of one type.
Correct answer
DA list can combine vectors of different types, while a vector holds values of one type.
Explanation
The example combines a character vector of names and a numeric vector of IQ scores into a list.
- A
- 19
Why are matrices important in many statistical applications of R?
- A
They automatically remove missing values from every dataset.
- B
They convert all data into graphical output.
- C
They are the only R data structure that can contain numeric values.
- D
They provide row and column structure for locating data points, and many statistical functions use them.
Correct answer
DThey provide row and column structure for locating data points, and many statistical functions use them.
Explanation
A matrix has row and column attributes and is used by many statistical functions, including regression-related methods.
- A
- 20
What does a data frame represent in the workshop's examples?
- A
A function that calculates summary statistics for one variable.
- B
A single string containing all observations in sequence.
- C
A matrix that cannot contain named variables.
- D
A table in which variables appear as columns and observations as rows.
Correct answer
DA table in which variables appear as columns and observations as rows.
Explanation
The data frame example displays names and IQ scores as columns and people as rows.
- A
- 21
Why might class(names) return "character" for a vector of names?
- A
The values in the vector are all logical tests.
- B
The values in the vector are text strings.
- C
The vector has been converted into a matrix.
- D
The vector contains only missing values.
Correct answer
BThe values in the vector are text strings.
Explanation
The names Peter, John, Mary, and Kate are strings, so their vector has character class.
- A
- 22
What is the effect of using a lowercase x when the defined object is named uppercase X?
- A
R automatically changes x to X because variable names are case-insensitive.
- B
R interprets x as a request to display the matrix dimensions.
- C
R combines the two names into a single variable.
- D
R treats x and X as different names, so it may report that x is not found.
Correct answer
DR treats x and X as different names, so it may report that x is not found.
Explanation
R is case-sensitive, so uppercase X and lowercase x refer to different object names.
- A
- 23
In an R function, what is an argument?
- A
The final result printed by the function.
- B
An input value or variable that the function can use.
- C
A comment describing the function's purpose.
- D
A package that must be installed for every function.
Correct answer
BAn input value or variable that the function can use.
Explanation
An argument supplies input data to a function, which then applies its expression or operations.
- A
- 24
Which description best captures what a function does in R?
- A
It applies specified operations to input data and can produce a result.
- B
It stores a table without allowing operations on the data.
- C
It installs a programming language on the computer.
- D
It changes every input into a character string.
Correct answer
AIt applies specified operations to input data and can produce a result.
Explanation
Functions act on data and produce results according to the operations specified in their definition.
- A
- 25
Why does the greeting function use quotation marks around "Hello World!"?
- A
Quotation marks cause R to install a greeting package.
- B
Quotation marks are required only when defining matrices.
- C
Quotation marks identify the text as a string rather than a variable name.
- D
Quotation marks tell R to treat the text as a numeric value.
Correct answer
CQuotation marks identify the text as a string rather than a variable name.
Explanation
Text written in quotation marks is treated as a character string, not as the name of an object.
- A
- 26
What role do if, else if, and else statements play in the BMI function example?
- A
They select different actions or messages depending on the BMI conditions.
- B
They install and load packages needed for calculating BMI.
- C
They convert a BMI result into a data frame.
- D
They combine multiple vectors into a list.
Correct answer
AThey select different actions or messages depending on the BMI conditions.
Explanation
Conditional statements let the function check BMI ranges and print messages appropriate to the result.
- A
- 27
What does a default argument such as print.median = FALSE imply in a function?
- A
The function will always print the median, even if told not to.
- B
The function cannot accept a vector as input.
- C
The function will omit the median unless the user requests it.
- D
The function will calculate neither the mean nor the standard deviation.
Correct answer
CThe function will omit the median unless the user requests it.
Explanation
A FALSE default means the median is not printed unless the argument is explicitly set to TRUE.
- A
- 28
Why should separate commands in a multi-line function be clearly separated?
- A
R permits only one assignment in each function.
- B
Separate lines convert numeric values into character values.
- C
R needs to recognize where one operation ends and the next begins.
- D
Every new line automatically creates a different function.
Correct answer
CR needs to recognize where one operation ends and the next begins.
Explanation
Clear command separation helps R interpret each assignment and operation as intended.
- A
- 29
What is the purpose of the data model described in the workshop?
- A
To organize the steps that turn raw data into results and communicable tables or figures.
- B
To choose a machine-learning algorithm before examining any data.
- C
To ensure that every dataset can be analyzed without preprocessing.
- D
To replace data collection with statistical modeling.
Correct answer
ATo organize the steps that turn raw data into results and communicable tables or figures.
Explanation
The model describes a workflow from obtaining data through processing, analysis, visualization, and communication.
- A
- 30
Which sequence best reflects the data workflow presented in the workshop?
- A
Model data, communicate results, import data, and then decide whether to clean it.
- B
Visualize data, discard the raw data, and then import the model output.
- C
Communicate results, import data, and avoid further analysis.
- D
Import data, tidy or transform it, visualize it, model it, and communicate results.
Correct answer
DImport data, tidy or transform it, visualize it, model it, and communicate results.
Explanation
The workflow includes importing, cleaning or transforming, visualizing, modeling, and communicating data and results.
- A
- 31
What is the purpose of tidying or transforming a dataset before analysis?
- A
To make the dataset contain only one variable.
- B
To guarantee that the analysis will produce statistically significant results.
- C
To replace the original observations with model predictions.
- D
To clean or reshape the table into a form suitable for the intended analysis.
Correct answer
DTo clean or reshape the table into a form suitable for the intended analysis.
Explanation
Tidying and transformation prepare data by cleaning or reshaping it for analysis.
- A
- 32
What is the difference between installing and loading an R package?
- A
Installation runs the package's functions; loading permanently saves a dataset.
- B
Installation adds the package to the computer; loading makes it available in the current R session.
- C
Installation creates a plot; loading converts the plot into a data frame.
- D
Installation and loading are identical steps that must be done only once.
Correct answer
BInstallation adds the package to the computer; loading makes it available in the current R session.
Explanation
The workshop uses install.package() to obtain a package and library() to load an installed package for use.
- A
- 33
Why use library(tidyverse) after installing tidyverse?
- A
It loads the installed package so its tools can be used in the session.
- B
It automatically runs every data-cleaning function in the package.
- C
It converts the current working directory into a package.
- D
It downloads the dataset from the internet without reading a file.
Correct answer
AIt loads the installed package so its tools can be used in the session.
Explanation
The library() function loads an installed package into the current R session.
- A
- 34
Which tidyverse package was identified as useful for importing CSV files?
- A
readr
- B
ggplot2
- C
tidyr
- D
dplyr
Correct answer
Areadr
Explanation
The workshop identifies readr as the tidyverse package used for data import, including the read_csv() function.
- A
- 35
Which set of variables was described as appearing in the gapminder dataset?
- A
Country, age, income, treatment, diagnosis, and test score.
- B
Person, date, weight, height, BMI, and exercise level.
- C
City, month, rainfall, temperature, longitude, and latitude.
- D
Country, year, population, continent, life expectancy, and GDP per capita.
Correct answer
DCountry, year, population, continent, life expectancy, and GDP per capita.
Explanation
The six variables listed for gapminder are country, year, population, continent, lifeExp, and gdpPercap.
- A
- 36
What does dim(gapminder) provide?
- A
The names of all countries in the dataset.
- B
A summary of the mean for each numeric variable.
- C
The first six observations and their values.
- D
The number of rows and columns in the dataset.
Correct answer
DThe number of rows and columns in the dataset.
Explanation
The dim() function reports a dataset's dimensions, such as its row and column counts.
- A
- 37
How do head() and tail() differ when used on a dataset?
- A
head() displays columns, while tail() displays only row numbers.
- B
head() displays the first rows, while tail() displays the last rows.
- C
head() displays variable names, while tail() displays variable classes.
- D
head() removes missing values, while tail() counts them.
Correct answer
Bhead() displays the first rows, while tail() displays the last rows.
Explanation
The workshop uses head() to inspect the first six rows and tail() to inspect the last six rows.
- A
- 38
What does names(gapminder) return?
- A
The number of rows in the dataset.
- B
The average of all numeric variables.
- C
The unique values of the country variable.
- D
The names of the dataset's variables.
Correct answer
DThe names of the dataset's variables.
Explanation
The names() function returns the variable names in a data frame.
- A
- 39
Why can mean(age) return a missing result if age contains NA?
- A
The mean function accepts only character vectors.
- B
NA values are interpreted as zeros and make the vector nonnumeric.
- C
The mean calculation encounters a missing value and, by default, does not remove it.
- D
The mean function automatically filters out every observation.
Correct answer
CThe mean calculation encounters a missing value and, by default, does not remove it.
Explanation
By default, mean() does not remove missing values, so an NA in the input can make the result NA.
- A
- 40
How can mean() calculate an average while excluding missing values?
- A
Convert the vector to a matrix before calling mean().
- B
Set na.rm = TRUE in the mean() call.
- C
Set na.rm = FALSE in the mean() call.
- D
Use head() to remove the missing observations.
Correct answer
BSet na.rm = TRUE in the mean() call.
Explanation
Setting na.rm = TRUE tells mean() to remove NA values before calculating.
- A
- 41
How would you create a dataset containing only gapminder observations from 2007?
- A
Use names() to rename every year value as 2007.
- B
Use filter() to keep rows whose year equals 2007.
- C
Use mean() to average the year variable.
- D
Use dim() to select rows with six columns.
Correct answer
BUse filter() to keep rows whose year equals 2007.
Explanation
The filter() function selects rows satisfying a condition, such as year == 2007.
- A
- 42
What is the purpose of selecting rows where continent equals Asia?
- A
To create a subset containing observations for the Asian continent.
- B
To calculate the average population of every continent.
- C
To rename the continent variable as Asia for every observation.
- D
To convert all country names into numeric values.
Correct answer
ATo create a subset containing observations for the Asian continent.
Explanation
Filtering on continent == "Asia" retains the observations identified as belonging to Asia.
- A
- 43
Why might a researcher filter gapminder for population above ten million?
- A
To calculate the total number of countries in the dataset.
- B
To create a subset focused on observations meeting a population threshold.
- C
To transform population into a categorical variable automatically.
- D
To replace population values with the number ten million.
Correct answer
BTo create a subset focused on observations meeting a population threshold.
Explanation
A filter condition can select rows with population greater than a chosen threshold.
- A
- 44
Why is data visualization valuable when exploring or communicating results?
- A
A graph ensures that every viewer reaches the same interpretation.
- B
A graph guarantees that an observed pattern is statistically significant.
- C
Visual displays make it unnecessary to inspect or analyze the data.
- D
Visual displays can make patterns easier to perceive than text or raw data alone.
Correct answer
DVisual displays can make patterns easier to perceive than text or raw data alone.
Explanation
The workshop emphasizes that visual representations can communicate concepts quickly and make patterns easier to see.
- A
- 45
What does the workshop mean by describing ggplot2 as a layer-based plotting system?
- A
Each plot must be made from a different dataset and cannot be modified.
- B
Each layer replaces the previous one rather than contributing to the figure.
- C
A plot's axes are added only after the graph has been exported.
- D
A plot can be built by adding components such as points or other graphical elements.
Correct answer
DA plot can be built by adding components such as points or other graphical elements.
Explanation
ggplot2 builds figures by combining a data mapping with additional layers, such as geometries.
- A
- 46
In ggplot(gapminder, aes(x = gdpPercap, y = lifeExp)), what does aes() specify?
- A
Which package should be installed before plotting.
- B
Which rows should be removed from the dataset.
- C
Which statistical test should be applied to the variables.
- D
Which data variables are mapped to the plot's visual properties, such as the axes.
Correct answer
DWhich data variables are mapped to the plot's visual properties, such as the axes.
Explanation
The aesthetics mapping assigns gdpPercap to the x-axis and lifeExp to the y-axis.
- A
- 47
Which geometry adds a scatter plot of individual data points in ggplot2?
- A
geom_histogram()
- B
geom_boxplot()
- C
geom_line()
- D
geom_point()
Correct answer
Dgeom_point()
Explanation
The workshop uses geom_point() to add one plotted point for each observation.
- A
- 48
What does setting alpha to 0.5 for points generally do?
- A
It changes the x-axis into a categorical variable.
- B
It doubles the number of observations shown.
- C
It removes points that overlap.
- D
It makes the points partially transparent.
Correct answer
DIt makes the points partially transparent.
Explanation
The alpha setting controls transparency; an alpha level of 0.5 makes points partly transparent.
- A
- 49
How can continent be shown using different point colors in the scatter plot?
- A
Replace geom_point() with mean().
- B
Use dim() to assign a color to each row.
- C
Set the data argument to continent only.
- D
Map continent to the color aesthetic.
Correct answer
DMap continent to the color aesthetic.
Explanation
Mapping color to continent lets the plot distinguish observations by their continent category.
- A
- 50
Which plot type was used to compare life expectancy distributions across continents?
- A
A line plot of variable names.
- B
A scatter plot with no grouping.
- C
A histogram.
- D
A box plot.
Correct answer
DA box plot.
Explanation
The workshop uses a box plot to compare life expectancy distributions across continents.
- A
- 51
What is a histogram used to display in the life expectancy example?
- A
The relationship between each country's GDP and population.
- B
The counts of observations across values or intervals of life expectancy.
- C
The names of countries ranked by continent.
- D
The median life expectancy for each year only.
Correct answer
BThe counts of observations across values or intervals of life expectancy.
Explanation
A histogram shows the frequency or count of observations across the values of a variable.
- A
- 52
What kind of relationship can a scatter plot of GDP per capita and life expectancy help reveal?
- A
Whether the dataset contains missing values in all variables.
- B
Whether country names determine the number of dataset columns.
- C
Whether higher GDP per capita tends to coincide with higher life expectancy.
- D
Whether life expectancy is the same for every observation.
Correct answer
CWhether higher GDP per capita tends to coincide with higher life expectancy.
Explanation
The plotted pattern can help reveal an association between GDP per capita and life expectancy.
- A
- 53
What information can point size represent in a scatter plot, as in the workshop's example?
- A
The statistical significance of every observation.
- B
The number of layers in the plot.
- C
An additional variable such as population.
- D
The name of the selected plotting package.
Correct answer
CAn additional variable such as population.
Explanation
The example uses point size to convey population, allowing a third variable to be represented in the plot.
- A
- 54
What does the workshop suggest a viewer can learn from a multivariate visualization?
- A
It can prove the causal effect of one plotted variable on another.
- B
It can show several patterns at once, such as associations and differences among groups.
- C
It can replace all descriptive and inferential statistical analysis.
- D
It can guarantee that the variables were measured without error.
Correct answer
BIt can show several patterns at once, such as associations and differences among groups.
Explanation
A well-designed figure can reveal multiple features of the data, but visual patterns alone do not establish causation.
- A
- 55
What does summary() provide when applied to a dataset?
- A
A summary of each variable, including descriptive statistics for numeric variables.
- B
A filtered dataset containing only complete observations.
- C
A list of all functions available in R.
- D
A graph showing every pairwise relationship among variables.
Correct answer
AA summary of each variable, including descriptive statistics for numeric variables.
Explanation
The workshop uses summary() to obtain information about each variable, including statistics such as means and medians for numeric variables.
- A
- 56
How can a researcher obtain summaries separately for each continent?
- A
Use a grouping or by operation that applies summary to each continent's data.
- B
Use read_csv() to split the data into continent groups.
- C
Use names() to assign each continent a different summary value.
- D
Use dim() to calculate separate means for each continent.
Correct answer
AUse a grouping or by operation that applies summary to each continent's data.
Explanation
The workshop demonstrates applying summary by continent to obtain summaries for each group.
- A
- 57
How can R be used to count the number of distinct countries in gapminder?
- A
Find unique country values and apply length() to that result.
- B
Use head() and multiply the displayed rows by six.
- C
Use class() on the country variable and count its data type.
- D
Apply mean() to the country names and count the decimal places.
Correct answer
AFind unique country values and apply length() to that result.
Explanation
unique() returns distinct values, and length() counts the values in that result; the workshop reports 142 countries.
- A
- 58
What does the expression gapminder$country select?
- A
Every row in gapminder that contains a dollar amount.
- B
The country with the highest population.
- C
The country variable from the gapminder data frame.
- D
The statistical model fitted to gapminder.
Correct answer
CThe country variable from the gapminder data frame.
Explanation
The dollar-sign notation accesses a named variable, such as country, within a data frame.
- A
- 59
What does a correlation value of about 0.58 between GDP per capita and life expectancy indicate?
- A
There is no relationship between the variables.
- B
The two variables are identical for every observation.
- C
GDP per capita causes a 58 percent increase in life expectancy.
- D
The variables have a positive association in the analyzed data.
Correct answer
DThe variables have a positive association in the analyzed data.
Explanation
A positive correlation indicates that higher values of one variable tend to be associated with higher values of the other; it does not establish causation.
- A
- 60
Why would a researcher filter the data to Europe and Asia before comparing their life expectancies with a t-test?
- A
The subset ensures the comparison focuses on observations from the two continents of interest.
- B
Filtering guarantees that the groups have equal means.
- C
Filtering makes the test paired by matching every country automatically.
- D
Filtering converts the life expectancy variable into a categorical variable.
Correct answer
AThe subset ensures the comparison focuses on observations from the two continents of interest.
Explanation
Filtering selects the groups to be compared; the t-test then evaluates their life expectancy difference.
- A
- 61
In the Europe-versus-Asia t-test described, what does a negative t-value indicate in the present comparison?
- A
The data contain a negative number of observations.
- B
The estimated difference has the direction associated with Europe having higher life expectancy than Asia under the test's group ordering.
- C
The test proves that the groups have exactly equal means.
- D
The p-value must be greater than the chosen significance threshold.
Correct answer
BThe estimated difference has the direction associated with Europe having higher life expectancy than Asia under the test's group ordering.
Explanation
The presenter interprets the negative t-value in this comparison as indicating higher life expectancy for Europe than Asia, given the way the groups are ordered.
- A
- 62
What does paired = TRUE specify in the t-test comparing 2002 and 2007?
- A
The analysis should treat the observations from the two years as paired.
- B
The data should be filtered to include only one year.
- C
The two years should be treated as unrelated groups.
- D
The test should compare the years' population totals instead of life expectancy.
Correct answer
AThe analysis should treat the observations from the two years as paired.
Explanation
The paired = TRUE argument requests a paired-sample t-test for the comparison.
- A
- 63
Why does the workshop convert year to a factor before comparing 2002 and 2007?
- A
To calculate a continuous trend from the two years.
- B
To treat the year values as categories rather than as numeric measurements.
- C
To ensure that every country appears in only one year.
- D
To remove the year variable from the dataset.
Correct answer
BTo treat the year values as categories rather than as numeric measurements.
Explanation
The year values are numeric, so converting them to a factor makes them function as categorical group labels.
- A
- 64
In the linear model lifeExp predicted by population, GDP per capita, and year, what are those three variables serving as?
- A
Alternative names for the model residuals.
- B
Categories of the response variable.
- C
Output statistics calculated after fitting the model.
- D
Predictors of life expectancy.
Correct answer
DPredictors of life expectancy.
Explanation
The model uses population, GDP per capita, and year to predict the outcome lifeExp.
- A
- 65
What does a model residual represent?
- A
The correlation between two input variables.
- B
The average value of every predictor in the dataset.
- C
The number of groups used in a t-test.
- D
The part of an observation's outcome not explained by the fitted model.
Correct answer
DThe part of an observation's outcome not explained by the fitted model.
Explanation
Residuals represent unexplained variation: the differences between observed outcomes and the model's fitted values.
- A
- 66
What does an adjusted R2 of about 0.439 indicate in the workshop's interpretation?
- A
The model accounts for about 44% of the outcome variance, under the stated interpretation.
- B
The model predicts exactly 44% of individual observations correctly.
- C
The model has a 44% probability of being statistically significant.
- D
The predictors explain 44% of the missing values in the dataset.
Correct answer
AThe model accounts for about 44% of the outcome variance, under the stated interpretation.
Explanation
The presenter interprets the adjusted R2 of 0.4392 as the model explaining about 44% of the variance.
- A
- 67
What can be done with model coefficients after fitting a linear model in R?
- A
They can be extracted only by rebuilding the model in a menu-based program.
- B
They can be used to recover every missing value with certainty.
- C
They can be extracted from the model object for inspection or further use.
- D
They automatically replace the original observations in the dataset.
Correct answer
CThey can be extracted from the model object for inspection or further use.
Explanation
The workshop shows extracting coefficients from a fitted model object, illustrating how R can provide specific model results.
- A
- 68
What is the purpose of comments in an R script?
- A
To convert a script into a package automatically.
- B
To remove the need to use meaningful variable names.
- C
To make R execute an additional hidden analysis.
- D
To explain the code or the information a command is intended to provide.
Correct answer
DTo explain the code or the information a command is intended to provide.
Explanation
Comments document code for readers; they describe what a command or analysis does rather than running it.
- A
- 69
What does R Markdown allow a researcher to combine?
- A
A data frame with a computer operating system.
- B
A graphical menu with an automatically selected hypothesis.
- C
A written document with programming and analysis results.
- D
An R package with an online search engine.
Correct answer
CA written document with programming and analysis results.
Explanation
The workshop describes R Markdown as a way to create a document that includes programming and results.
- A
- 70
Which pattern distinguishes the big-data example from the typical experiment described?
- A
Big data may contain many variables but comparatively fewer subjects, while experiments often have many subjects and fewer variables.
- B
Big data and experiments necessarily have identical numbers of subjects and variables.
- C
Big data always has more subjects and fewer variables than an experiment.
- D
Big data contains no variables, while experiments contain only variables.
Correct answer
ABig data may contain many variables but comparatively fewer subjects, while experiments often have many subjects and fewer variables.
Explanation
The workshop contrasts experiment-generated data, often with many subjects and few variables, with big data that may have many variables and fewer subjects.
- A
- 71
Why can feature reduction be important when analyzing high-dimensional big data?
- A
It increases the number of subjects in the dataset.
- B
It changes an unsupervised task into a supervised one automatically.
- C
It guarantees that the remaining variables are causal.
- D
It can help select a manageable set of variables for prediction or analysis.
Correct answer
DIt can help select a manageable set of variables for prediction or analysis.
Explanation
The workshop notes that big data can have many variables and that machine-learning approaches may reduce or select features.
- A
- 72
What is machine learning, as described in the workshop?
- A
A statistical test used only to compare two group means.
- B
A set of general algorithms that learn patterns from data rather than being fully specified for one phenomenon.
- C
A method that uses only fixed rules written in advance and ignores data.
- D
A type of dataset that contains more subjects than variables.
Correct answer
BA set of general algorithms that learn patterns from data rather than being fully specified for one phenomenon.
Explanation
Machine-learning algorithms learn from data and are not necessarily written for one specific phenomenon or research question.
- A
- 73
According to the workshop, how can more information affect a machine-learning algorithm?
- A
More information always makes performance worse.
- B
More information guarantees perfect predictions.
- C
More information eliminates the need to evaluate the algorithm.
- D
More information can improve performance, although the quality and relevance of the data still matter.
Correct answer
DMore information can improve performance, although the quality and relevance of the data still matter.
Explanation
The workshop notes that additional information can lead to higher algorithm performance, while also cautioning that more data is not necessarily better data.
- A
- 74
What is the goal of a classification problem?
- A
Assign an observation to one of a set of categories based on its features.
- B
Calculate the mean and standard deviation of a vector.
- C
Estimate a continuous numerical outcome from predictors.
- D
Find hidden groups using input data without known categories.
Correct answer
AAssign an observation to one of a set of categories based on its features.
Explanation
Classification identifies which category or class an observation belongs to based on its features.
- A
- 75
What is the goal of a regression problem in machine learning?
- A
Use features to predict an outcome, potentially for new samples.
- B
Assign each observation to a known category only.
- C
Find groups without using output labels.
- D
Display the distribution of one variable as bars.
Correct answer
AUse features to predict an outcome, potentially for new samples.
Explanation
Regression builds a predictive model from features to an outcome and can be applied to new samples.
- A
- 76
What is the purpose of clustering?
- A
Assign observations to categories that were specified in advance.
- B
Predict a known continuous outcome using labeled examples only.
- C
Identify groups or hidden structure based on similarities among observations.
- D
Test whether two group means are significantly different.
Correct answer
CIdentify groups or hidden structure based on similarities among observations.
Explanation
Clustering seeks hidden patterns or structure by grouping observations according to similarity.
- A
- 77
Which pair of methods is presented as supervised learning?
- A
Clustering and descriptive summaries.
- B
Classification and regression.
- C
Tidying and importing.
- D
Clustering and visualization.
Correct answer
BClassification and regression.
Explanation
The workshop identifies classification and regression as supervised methods that use input and output information to build predictive models.
- A
- 78
Why is clustering classified as unsupervised learning?
- A
It predicts a labeled outcome from both inputs and outputs.
- B
It requires the researcher to specify the correct class for every observation.
- C
It groups or interprets data using input data without relying on known output labels.
- D
It compares the means of two predefined groups.
Correct answer
CIt groups or interprets data using input data without relying on known output labels.
Explanation
Clustering is unsupervised because it searches for structure using input data without known output labels.
- A
- 79
How does the workshop distinguish inference from prediction?
- A
Inference and prediction are identical tasks with different names.
- B
Inference uses only big data, while prediction uses only small experiments.
- C
Inference builds a model to understand or test how a system behaves, while prediction forecasts unobserved outcomes.
- D
Inference forecasts future cases, while prediction only summarizes past data.
Correct answer
CInference builds a model to understand or test how a system behaves, while prediction forecasts unobserved outcomes.
Explanation
Inference focuses on formalizing understanding or testing hypotheses about a data-generating system; prediction focuses on forecasting unobserved outcomes or future behavior.
- A
- 80
Which comparison between classical statistics and machine learning matches the workshop's emphasis?
- A
Classical statistics is often strong for inference and understanding, while machine learning is often strong for prediction.
- B
Classical statistics is always more accurate, regardless of the question or data.
- C
Classical statistics requires big data, while machine learning requires only laboratory data.
- D
Classical statistics cannot make predictions, while machine learning cannot support inference.
Correct answer
AClassical statistics is often strong for inference and understanding, while machine learning is often strong for prediction.
Explanation
The workshop presents classical statistics as particularly suited to understanding behavior and testing hypotheses, and machine learning as particularly suited to prediction, while noting that the boundary is not clear-cut.
- A
- 81
What lesson does the Google Flu Trends example illustrate?
- A
Public awareness changed search behavior, which weakened the relationship between searches and flu activity.
- B
A large dataset cannot be affected by changes in human behavior.
- C
Search data always provide a more accurate estimate of flu than public health data.
- D
Media attention caused the CDC to stop recording influenza activity.
Correct answer
APublic awareness changed search behavior, which weakened the relationship between searches and flu activity.
Explanation
After the prediction system received media attention, more people searched for flu-related information, including people without flu symptoms, which led to overprediction.
- A
- 82
What broader conclusion does the Google Flu Trends case support?
- A
Large amounts of data do not automatically make data better or predictions more reliable.
- B
Traditional data collection should always be replaced by online data.
- C
Search behavior is always a direct measure of disease incidence.
- D
Predictive models cannot be affected by changes in public behavior.
Correct answer
ALarge amounts of data do not automatically make data better or predictions more reliable.
Explanation
The case shows that data features and the way they are generated must be considered; more data alone does not guarantee better data.
- A
- 83
How does the workshop recommend using big data in relation to experimental research?
- A
Use it to generate novel hypotheses, then test those hypotheses with experiments when appropriate.
- B
Use it only after an experiment has proven every possible relationship.
- C
Avoid using it because it cannot provide useful insight.
- D
Use it to replace all experiments and confirm every causal claim.
Correct answer
AUse it to generate novel hypotheses, then test those hypotheses with experiments when appropriate.
Explanation
The presenter favors using big data to generate hypotheses and then conducting experiments to confirm them.
- A
- 84
What is a central reason the workshop gives for learning R in preparation for data challenges?
- A
R supports reproducible research and provides tools for working with data, including large datasets.
- B
R can be used only for small, manually entered datasets.
- C
R ensures that every big-data project avoids bias.
- D
R removes the need to assess whether a method is legitimate.
Correct answer
AR supports reproducible research and provides tools for working with data, including large datasets.
Explanation
The workshop presents R as useful for reproducible research and as a way to prepare for big-data challenges, while still urging care about methods and data quality.
- A

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